Skip to content

Commit 6c86dfa

Browse files
committed
WIP fix internal types
1 parent ae1a53d commit 6c86dfa

File tree

7 files changed

+9551
-9531
lines changed

7 files changed

+9551
-9531
lines changed

scripts/update-endpoints/types.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function generateTypes() {
6969
`${method.name}: {
7070
(params?: RestEndpointMethodTypes["${namespace.namespace}"]["${method.name}"]["parameters"]): Promise<RestEndpointMethodTypes["${namespace.namespace}"]["${method.name}"]["response"]>
7171
72-
endpoint: EndpointInterface;
72+
endpoint: EndpointInterface<{ url: string }>;
7373
}`,
7474
].join("\n")
7575
);
@@ -82,10 +82,11 @@ async function generateTypes() {
8282

8383
const methodTypesSource = prettier.format(
8484
[
85-
`import { Endpoints, RequestParameters } from "@octokit/types";`,
85+
`import { EndpointInterface } from "@octokit/types";`,
86+
`import { RestEndpointMethodTypes } from "./method-types";`,
8687
"",
87-
`export type RestEndpointMethodTypes = {
88-
${RestEndpointMethodParameterAndResponseTypes.join("\n")}
88+
`export type RestEndpointMethods = {
89+
${RestEndpointMethodNamespaceTypes.join("\n")}
8990
}`,
9091
].join("\n"),
9192
{
@@ -94,11 +95,10 @@ async function generateTypes() {
9495
);
9596
const parametersAndResponsesTypes = prettier.format(
9697
[
97-
`import { EndpointInterface } from "@octokit/types";`,
98-
`import { RestEndpointMethodTypes } from "./method-types";`,
98+
`import { Endpoints, RequestParameters } from "@octokit/types";`,
9999
"",
100-
`export type RestEndpointMethods = {
101-
${RestEndpointMethodNamespaceTypes.join("\n")}
100+
`export type RestEndpointMethodTypes = {
101+
${RestEndpointMethodParameterAndResponseTypes.join("\n")}
102102
}`,
103103
].join("\n"),
104104
{

src/endpoints-to-methods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Url,
88
} from "@octokit/types";
99
import { EndpointsDefaultsAndDecorations, EndpointDecorations } from "./types";
10-
import { RestEndpointMethods } from "./generated/parameters-and-response-types";
10+
import { RestEndpointMethods } from "./generated/method-types";
1111

1212
type EndpointMethods = {
1313
[methodName: string]: typeof Octokit.prototype.request;

0 commit comments

Comments
 (0)