Skip to content

Commit

Permalink
import/export types explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
kfcampbell committed Jun 5, 2023
1 parent 451ca57 commit 8dc37c5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0-development",
"description": "Octokit plugin adding one method for all of api.github.com REST API endpoints",
"scripts": {
"build": "node scripts/build.mjs && tsc -p tsconfig.json",
"build": "node scripts/build.mjs && tsc -p tsconfig.json --verbatimModuleSyntax",
"lint": "prettier --check '{src,test}/**/*' '!src/generated/**' README.md package.json",
"lint:fix": "prettier --write '{src,test}/**/*' '!src/generated/**' README.md package.json",
"pretest": "npm run -s lint",
Expand Down
6 changes: 3 additions & 3 deletions src/endpoints-to-methods.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Octokit } from "@octokit/core";
import {
import type {
EndpointOptions,
RequestParameters,
RequestMethod,
Route,
Url,
} from "@octokit/types";
import { EndpointsDefaultsAndDecorations, EndpointDecorations } from "./types";
import { RestEndpointMethods } from "./generated/method-types";
import type { EndpointsDefaultsAndDecorations, EndpointDecorations } from "./types";
import type { RestEndpointMethods } from "./generated/method-types";

type EndpointMethods = {
[methodName: string]: typeof Octokit.prototype.request;
Expand Down
2 changes: 1 addition & 1 deletion src/generated/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EndpointsDefaultsAndDecorations } from "../types";
import type { EndpointsDefaultsAndDecorations } from "../types";
const Endpoints: EndpointsDefaultsAndDecorations = {
actions: {
addCustomLabelsToSelfHostedRunnerForOrg: [
Expand Down
4 changes: 2 additions & 2 deletions src/generated/method-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EndpointInterface, RequestInterface } from "@octokit/types";
import { RestEndpointMethodTypes } from "./parameters-and-response-types";
import type { EndpointInterface, RequestInterface } from "@octokit/types";
import type { RestEndpointMethodTypes } from "./parameters-and-response-types";

export type RestEndpointMethods = {
actions: {
Expand Down
2 changes: 1 addition & 1 deletion src/generated/parameters-and-response-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Endpoints, RequestParameters } from "@octokit/types";
import type { Endpoints, RequestParameters } from "@octokit/types";

export type RestEndpointMethodTypes = {
actions: {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Octokit } from "@octokit/core";

import ENDPOINTS from "./generated/endpoints";
export { RestEndpointMethodTypes } from "./generated/parameters-and-response-types";
export type { RestEndpointMethodTypes } from "./generated/parameters-and-response-types";
import { VERSION } from "./version";
import { Api } from "./types";
import type { Api } from "./types";
import { endpointsToMethods } from "./endpoints-to-methods";

export function restEndpointMethods(octokit: Octokit): Api {
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Route, RequestParameters } from "@octokit/types";
import type { Route, RequestParameters } from "@octokit/types";

import { RestEndpointMethods } from "./generated/method-types";
import type { RestEndpointMethods } from "./generated/method-types";

export type Api = { rest: RestEndpointMethods };

Expand Down

0 comments on commit 8dc37c5

Please sign in to comment.