@wix/sdk
Advanced tools
Comparing version
@@ -14,15 +14,8 @@ import { AuthenticationStrategy, BoundAuthenticationStrategy, BuildEventDefinition, BuildRESTFunction, EventDefinition, EventIdentity, Host, HostModule, HostModuleAPI, RESTFunctionDescriptor, SPIDefinition } from '@wix/sdk-types'; | ||
*/ | ||
export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined> = BuildRESTDescriptors<T> & BuildAmbassadorDescriptors<T> & BuildEventDefinitions<T> & (H extends Host<any> ? BuildHostDescriptors<T> : {}); | ||
type BuildRESTDescriptors<T extends Descriptors> = T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildRESTDescriptors<T[Key]> : never; | ||
}, EmptyObject>; | ||
type BuildAmbassadorDescriptors<T extends Descriptors> = T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildAmbassadorDescriptors<T[Key]> : never; | ||
}, EmptyObject>; | ||
type BuildHostDescriptors<T extends Descriptors> = T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildHostDescriptors<T[Key]> : never; | ||
}, EmptyObject>; | ||
type BuildEventDefinitions<T extends Descriptors> = T extends EventDefinition ? BuildEventDefinition<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildEventDefinitions<T[Key]> : never; | ||
}, EmptyObject>; | ||
export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = { | ||
done: T; | ||
recurse: T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition ? BuildEventDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [-1, 0, 1, 2, 3, 4, 5][Depth]> : never; | ||
}, EmptyObject>; | ||
}[Depth extends -1 ? 'done' : 'recurse']; | ||
/** | ||
@@ -29,0 +22,0 @@ * Descriptors are objects that describe the API of a module, and the module |
@@ -14,15 +14,8 @@ import { AuthenticationStrategy, BoundAuthenticationStrategy, BuildEventDefinition, BuildRESTFunction, EventDefinition, EventIdentity, Host, HostModule, HostModuleAPI, RESTFunctionDescriptor, SPIDefinition } from '@wix/sdk-types'; | ||
*/ | ||
export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined> = BuildRESTDescriptors<T> & BuildAmbassadorDescriptors<T> & BuildEventDefinitions<T> & (H extends Host<any> ? BuildHostDescriptors<T> : {}); | ||
type BuildRESTDescriptors<T extends Descriptors> = T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildRESTDescriptors<T[Key]> : never; | ||
}, EmptyObject>; | ||
type BuildAmbassadorDescriptors<T extends Descriptors> = T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildAmbassadorDescriptors<T[Key]> : never; | ||
}, EmptyObject>; | ||
type BuildHostDescriptors<T extends Descriptors> = T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildHostDescriptors<T[Key]> : never; | ||
}, EmptyObject>; | ||
type BuildEventDefinitions<T extends Descriptors> = T extends EventDefinition ? BuildEventDefinition<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildEventDefinitions<T[Key]> : never; | ||
}, EmptyObject>; | ||
export type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = { | ||
done: T; | ||
recurse: T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition ? BuildEventDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{ | ||
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [-1, 0, 1, 2, 3, 4, 5][Depth]> : never; | ||
}, EmptyObject>; | ||
}[Depth extends -1 ? 'done' : 'recurse']; | ||
/** | ||
@@ -29,0 +22,0 @@ * Descriptors are objects that describe the API of a module, and the module |
{ | ||
"name": "@wix/sdk", | ||
"version": "1.9.2", | ||
"version": "1.9.3", | ||
"license": "UNLICENSED", | ||
@@ -123,3 +123,3 @@ "author": { | ||
}, | ||
"falconPackageHash": "71774a6a839caae0eb644c899a798b3b14296d9c6321d8fae8dfeca5" | ||
"falconPackageHash": "b793f7d8e56d121118c1a7a6f27eb8df6d14f23cdc6399d6352dd96f" | ||
} |
156691
-0.76%3844
-0.36%