mirror of
https://github.com/strapi/strapi.git
synced 2025-12-03 10:32:10 +00:00
Remove 4.7 based features, added some comments
This commit is contained in:
parent
e62efa2a6a
commit
ee211466ce
3
packages/core/strapi/lib/global.d.ts
vendored
3
packages/core/strapi/lib/global.d.ts
vendored
@ -41,6 +41,9 @@ declare global {
|
||||
*/
|
||||
type ComponentUIDs = KeysBy<Schemas, ComponentSchema>;
|
||||
|
||||
/**
|
||||
* Global shorthand to access the `StrapiInterface` type
|
||||
*/
|
||||
type Strapi = StrapiInterface;
|
||||
}
|
||||
|
||||
|
||||
@ -56,16 +56,16 @@ export type GetAttributeValue<T extends Attribute> =
|
||||
| GetTextAttributeValue<T>
|
||||
| GetUIDAttributeValue<T>;
|
||||
|
||||
export type GetAttributeValueByKey<T extends SchemaUID, U extends GetAttributesKey<T>> = GetAttribute<T, U
|
||||
> extends infer P extends Attribute ? GetAttributeValue<P>:never;
|
||||
export type GetAttributeValueByKey<T extends SchemaUID, U extends GetAttributesKey<T>> = GetAttribute<T, U
|
||||
> extends infer P ? P extends Attribute ? GetAttributeValue<P> : never : never;
|
||||
|
||||
export type GetAttributesValues<T extends SchemaUID> = {
|
||||
// Handle required attributes
|
||||
[key in GetAttributesRequiredKeys<T>]-?: GetAttributeValueByKey<T, key>;
|
||||
} & {
|
||||
// Handle optional attributes
|
||||
[key in GetAttributesOptionalKeys<T>]?: GetAttributeValueByKey<T, key>;
|
||||
};
|
||||
// Handle optional attributes
|
||||
[key in GetAttributesOptionalKeys<T>]?: GetAttributeValueByKey<T, key>;
|
||||
};
|
||||
|
||||
export type GetAttributesRequiredKeys<T extends SchemaUID> = KeysBy<GetAttributes<T>, { required: true }>;
|
||||
export type GetAttributesOptionalKeys<T extends SchemaUID> = keyof Omit<
|
||||
|
||||
5
packages/core/strapi/lib/types/index.d.ts
vendored
5
packages/core/strapi/lib/types/index.d.ts
vendored
@ -1,3 +1,4 @@
|
||||
export * from './core';
|
||||
export * from './factories';
|
||||
export * from './utils'
|
||||
|
||||
export * as utils from './utils'
|
||||
export * as factories from './factories';
|
||||
Loading…
x
Reference in New Issue
Block a user