@octokit-next/types
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -20,3 +20,3 @@ import { RequestInterface } from "./request"; | ||
export namespace Octokit { | ||
interface Options { | ||
interface Options<TVersion extends keyof Octokit.ApiVersions = "github.com"> { | ||
/** | ||
@@ -29,3 +29,3 @@ * API version. Defaults to `"github.com"`. | ||
*/ | ||
version?: keyof Octokit.ApiVersions; | ||
version?: TVersion; | ||
@@ -65,7 +65,9 @@ /** | ||
interface RequestOptions { | ||
interface RequestOptions< | ||
TVersion extends keyof Octokit.ApiVersions = "github.com" | ||
> { | ||
/** | ||
* Override API version on a per-request basis. | ||
*/ | ||
version?: keyof Octokit.ApiVersions; | ||
version?: TVersion; | ||
@@ -161,3 +163,3 @@ /** | ||
TVersion extends keyof Octokit.ApiVersions = "github.com", | ||
TOptions extends Octokit.Options = Octokit.Options, | ||
TOptions extends Octokit.Options<TVersion> = Octokit.Options<TVersion>, | ||
TAuthStrategy extends AuthStrategyInterface | never = never | ||
@@ -213,3 +215,3 @@ > { | ||
ClassOne extends Constructor< | ||
Octokit<TVersion, Octokit.Options & PredefinedOptionsOne> | ||
Octokit<TVersion, Octokit.Options<TVersion> & PredefinedOptionsOne> | ||
> & | ||
@@ -220,7 +222,7 @@ ClassWithPlugins, | ||
this: ClassOne, | ||
defaults: PredefinedOptionsOne | ||
defaults: PredefinedOptionsOne & { version?: TVersion } | ||
): ConstructorRequiringOptionsIfNeeded<ClassOne, PredefinedOptionsOne> & { | ||
withDefaults<ClassTwo, PredefinedOptionsTwo>( | ||
this: ClassTwo, | ||
defaults: PredefinedOptionsTwo | ||
defaults: PredefinedOptionsTwo & { version?: TVersion } | ||
): ConstructorRequiringOptionsIfNeeded< | ||
@@ -232,3 +234,3 @@ ClassOne & ClassTwo, | ||
this: ClassThree, | ||
defaults: PredefinedOptionsThree | ||
defaults: PredefinedOptionsThree & { version?: TVersion } | ||
): ConstructorRequiringOptionsIfNeeded< | ||
@@ -260,3 +262,3 @@ ClassOne & ClassTwo & ClassThree, | ||
*/ | ||
options: { version: TVersion } & TOptions; | ||
options: TOptions; | ||
@@ -263,0 +265,0 @@ /** |
@@ -7,3 +7,3 @@ { | ||
"type": "module", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "Shared TypeScript definitions for upcoming Octokit SDK", | ||
@@ -10,0 +10,0 @@ "types": "./index.d.ts", |
import { Octokit } from "./index.js"; | ||
type EndpointParameters = { request: Octokit.RequestOptions } & Record< | ||
string, | ||
unknown | ||
>; | ||
type EndpointParameters | ||
<TVersion extends keyof Octokit.ApiVersions = "github.com"> = | ||
{ request: Octokit.RequestOptions<TVersion> } | ||
& Record<string, unknown>; | ||
@@ -59,3 +59,3 @@ type UnknownResponse = { | ||
} & ("parameters" extends keyof Endpoint | ||
? Endpoint["parameters"] & EndpointParameters | ||
? Endpoint["parameters"] & EndpointParameters<RVersion> | ||
: never) | ||
@@ -62,0 +62,0 @@ ): "response" extends keyof Endpoint ? Promise<Endpoint["response"]> : never; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15673
4
447