mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Fix the shared types resolving for Common.Schemas
This commit is contained in:
parent
4bf987e13d
commit
6bbcdf8d2a
154
examples/getstarted/types/generated/components.d.ts
vendored
Normal file
154
examples/getstarted/types/generated/components.d.ts
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
import type { Schema, Attribute } from '@strapi/strapi';
|
||||
|
||||
export interface BasicRelation extends Schema.Component {
|
||||
collectionName: 'components_basic_relations';
|
||||
info: {
|
||||
displayName: 'Relation';
|
||||
};
|
||||
attributes: {
|
||||
categories: Attribute.Relation<'basic.relation', 'oneToMany', 'api::category.category'>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface BasicSimple extends Schema.Component {
|
||||
collectionName: 'components_basic_simples';
|
||||
info: {
|
||||
displayName: 'simple';
|
||||
icon: 'ambulance';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required;
|
||||
test: Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
export interface BlogTestComo extends Schema.Component {
|
||||
collectionName: 'components_blog_test_comos';
|
||||
info: {
|
||||
displayName: 'test comp';
|
||||
icon: 'air-freshener';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.DefaultTo<'toto'>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultApple extends Schema.Component {
|
||||
collectionName: 'components_default_apples';
|
||||
info: {
|
||||
displayName: 'apple';
|
||||
icon: 'apple-alt';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultCar extends Schema.Component {
|
||||
collectionName: 'components_default_cars';
|
||||
info: {
|
||||
displayName: 'car';
|
||||
icon: 'align-right';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultClosingperiod extends Schema.Component {
|
||||
collectionName: 'components_closingperiods';
|
||||
info: {
|
||||
displayName: 'closingperiod';
|
||||
description: '';
|
||||
icon: 'angry';
|
||||
};
|
||||
attributes: {
|
||||
label: Attribute.String & Attribute.DefaultTo<'toto'>;
|
||||
start_date: Attribute.Date & Attribute.Required;
|
||||
end_date: Attribute.Date & Attribute.Required;
|
||||
media: Attribute.Media;
|
||||
dish: Attribute.Component<'default.dish', true> &
|
||||
Attribute.Required &
|
||||
Attribute.SetMinMax<{
|
||||
min: 2;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultDish extends Schema.Component {
|
||||
collectionName: 'components_dishes';
|
||||
info: {
|
||||
displayName: 'dish';
|
||||
description: '';
|
||||
icon: 'address-book';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.DefaultTo<'My super dish'>;
|
||||
description: Attribute.Text;
|
||||
price: Attribute.Float;
|
||||
picture: Attribute.Media;
|
||||
very_long_description: Attribute.RichText;
|
||||
categories: Attribute.Relation<'default.dish', 'oneToOne', 'api::category.category'>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultOpeningtimes extends Schema.Component {
|
||||
collectionName: 'components_openingtimes';
|
||||
info: {
|
||||
displayName: 'openingtimes';
|
||||
description: '';
|
||||
icon: 'calendar';
|
||||
};
|
||||
attributes: {
|
||||
label: Attribute.String & Attribute.Required & Attribute.DefaultTo<'something'>;
|
||||
time: Attribute.String;
|
||||
dishrep: Attribute.Component<'default.dish', true>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultRestaurantservice extends Schema.Component {
|
||||
collectionName: 'components_restaurantservices';
|
||||
info: {
|
||||
displayName: 'restaurantservice';
|
||||
description: '';
|
||||
icon: 'cannabis';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required & Attribute.DefaultTo<'something'>;
|
||||
media: Attribute.Media;
|
||||
is_available: Attribute.Boolean & Attribute.Required & Attribute.DefaultTo<true>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DefaultTemp extends Schema.Component {
|
||||
collectionName: 'components_default_temps';
|
||||
info: {
|
||||
displayName: 'temp';
|
||||
icon: 'adjust';
|
||||
description: '';
|
||||
};
|
||||
attributes: {
|
||||
name: Attribute.String & Attribute.Required;
|
||||
url: Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
declare module '@strapi/types' {
|
||||
export module Shared {
|
||||
export interface Components {
|
||||
'basic.relation': BasicRelation;
|
||||
'basic.simple': BasicSimple;
|
||||
'blog.test-como': BlogTestComo;
|
||||
'default.apple': DefaultApple;
|
||||
'default.car': DefaultCar;
|
||||
'default.closingperiod': DefaultClosingperiod;
|
||||
'default.dish': DefaultDish;
|
||||
'default.openingtimes': DefaultOpeningtimes;
|
||||
'default.restaurantservice': DefaultRestaurantservice;
|
||||
'default.temp': DefaultTemp;
|
||||
}
|
||||
}
|
||||
}
|
||||
1313
examples/getstarted/types/generated/contentTypes.d.ts
vendored
Normal file
1313
examples/getstarted/types/generated/contentTypes.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
import type { Attribute } from '..';
|
||||
|
||||
type BlocksAttribute = Attribute.OfType<'blocks'> &
|
||||
export type Blocks = Attribute.OfType<'blocks'> &
|
||||
// Options
|
||||
Attribute.ConfigurableOption &
|
||||
Attribute.PrivateOption &
|
||||
@ -10,8 +10,4 @@ type BlocksAttribute = Attribute.OfType<'blocks'> &
|
||||
|
||||
export type BlocksValue<T extends object = object> = T;
|
||||
|
||||
export type GetBlocksValue<T extends Attribute.Attribute> = T extends BlocksAttribute
|
||||
? BlocksValue
|
||||
: never;
|
||||
|
||||
export type Blocks = BlocksAttribute;
|
||||
export type GetBlocksValue<T extends Attribute.Attribute> = T extends Blocks ? BlocksValue : never;
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
import type { Shared } from '../..';
|
||||
import type { ContentTypes, Components } from '../../shared';
|
||||
|
||||
export type Schemas = Shared.ContentTypes & Shared.Components;
|
||||
export type Schemas = ContentTypes & Components;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user