mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 22:54:31 +00:00
Remove SchemaUID from the strapi/strapi ts utils
This commit is contained in:
parent
e0b3603447
commit
c1a3193a83
20
packages/core/strapi/lib/types/utils.d.ts
vendored
20
packages/core/strapi/lib/types/utils.d.ts
vendored
@ -107,26 +107,6 @@ export type PickBy<T, U> = Pick<T, KeysBy<T, U>>;
|
||||
*/
|
||||
export type NeverGuard<T, U = unknown> = [T] extends [never] ? U : T;
|
||||
|
||||
/**
|
||||
* Dynamic type based on the keys of `Strapi.Schemas`.
|
||||
* It represents all the registered schemas' UID as a union type.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* declare global {
|
||||
* namespace Strapi {
|
||||
* interface Schemas {
|
||||
* 'api::foo.foo': CollectionTypeSchema;
|
||||
* 'api::bar.bar': ComponentSchema;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* type X = SchemaUID;
|
||||
* // 'api::foo.foo' | 'api::bar.bar'
|
||||
*/
|
||||
export type SchemaUID = keyof Strapi.Schemas;
|
||||
|
||||
/**
|
||||
* Get the type of a specific key `U` in `T`
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user