mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Export type-space versions of constructors to fix extension API (#6990)
Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
8634c3b56f
commit
5eefa8f03a
@ -64,6 +64,11 @@ function KubeApiCstr<
|
|||||||
return api;
|
return api;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type KubeApi<
|
||||||
|
Object extends KubeObject = KubeObject,
|
||||||
|
Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>,
|
||||||
|
> = InternalKubeApi<Object, Data>;
|
||||||
|
|
||||||
export const KubeApi = KubeApiCstr as unknown as new<
|
export const KubeApi = KubeApiCstr as unknown as new<
|
||||||
Object extends KubeObject = KubeObject,
|
Object extends KubeObject = KubeObject,
|
||||||
Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>,
|
Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>,
|
||||||
@ -123,6 +128,8 @@ function KubeJsonApiCstr(config: JsonApiConfig, reqInit?: RequestInit) {
|
|||||||
return createKubeJsonApi(config, reqInit);
|
return createKubeJsonApi(config, reqInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type KubeJsonApi = InternalKubeJsonApi;
|
||||||
|
|
||||||
export const KubeJsonApi = Object.assign(
|
export const KubeJsonApi = Object.assign(
|
||||||
KubeJsonApiCstr as unknown as new (config: JsonApiConfig, reqInit?: RequestInit) => InternalKubeJsonApi,
|
KubeJsonApiCstr as unknown as new (config: JsonApiConfig, reqInit?: RequestInit) => InternalKubeJsonApi,
|
||||||
{
|
{
|
||||||
@ -204,30 +211,35 @@ function PodsApiConstructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions
|
|||||||
return new PodApi(getKubeApiDeps(), opts);
|
return new PodApi(getKubeApiDeps(), opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type PodsApi = PodApi;
|
||||||
export const PodsApi = PodsApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => PodApi;
|
export const PodsApi = PodsApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => PodApi;
|
||||||
|
|
||||||
function NodesApiConstructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) {
|
function NodesApiConstructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) {
|
||||||
return new NodeApi(getKubeApiDeps(), opts);
|
return new NodeApi(getKubeApiDeps(), opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type NodesApi = NodeApi;
|
||||||
export const NodesApi = NodesApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => NodeApi;
|
export const NodesApi = NodesApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => NodeApi;
|
||||||
|
|
||||||
function DeploymentApiConstructor(opts?: DerivedKubeApiOptions) {
|
function DeploymentApiConstructor(opts?: DerivedKubeApiOptions) {
|
||||||
return new InternalDeploymentApi(getKubeApiDeps(), opts);
|
return new InternalDeploymentApi(getKubeApiDeps(), opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type DeploymentApi = InternalDeploymentApi;
|
||||||
export const DeploymentApi = DeploymentApiConstructor as unknown as new (opts?: DerivedKubeApiOptions) => InternalDeploymentApi;
|
export const DeploymentApi = DeploymentApiConstructor as unknown as new (opts?: DerivedKubeApiOptions) => InternalDeploymentApi;
|
||||||
|
|
||||||
function IngressApiConstructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) {
|
function IngressApiConstructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) {
|
||||||
return new InternalIngressApi(getKubeApiDeps(), opts);
|
return new InternalIngressApi(getKubeApiDeps(), opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type IngressApi = InternalIngressApi;
|
||||||
export const IngressApi = IngressApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => InternalIngressApi;
|
export const IngressApi = IngressApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => InternalIngressApi;
|
||||||
|
|
||||||
function PersistentVolumeClaimsApiConstructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) {
|
function PersistentVolumeClaimsApiConstructor(opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) {
|
||||||
return new PersistentVolumeClaimApi(getKubeApiDeps(), opts);
|
return new PersistentVolumeClaimApi(getKubeApiDeps(), opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type PersistentVolumeClaimsApi = PersistentVolumeClaimApi;
|
||||||
export const PersistentVolumeClaimsApi = PersistentVolumeClaimsApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => PersistentVolumeClaimApi;
|
export const PersistentVolumeClaimsApi = PersistentVolumeClaimsApiConstructor as unknown as new (opts?: DerivedKubeApiOptions & IgnoredKubeApiOptions) => PersistentVolumeClaimApi;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user