mirror of
https://github.com/zhigang1992/firecms.git
synced 2026-06-13 17:25:44 +08:00
Small builders.ts types fix
This commit is contained in:
@@ -52,16 +52,13 @@ export const testEntitySchema = buildSchema({
|
||||
status,
|
||||
context
|
||||
}) => {
|
||||
console.log("custom onPreSave", collectionPath, id);
|
||||
|
||||
getNavigationFrom({
|
||||
return getNavigationFrom({
|
||||
path: `${collectionPath}/${id}`,
|
||||
context
|
||||
}).then((result) => console.log("getNavigationFrom", result));
|
||||
|
||||
if (!values.empty_string) values.empty_string = "";
|
||||
|
||||
return values;
|
||||
}).then((navigation) => {
|
||||
console.log("navigation", navigation);
|
||||
return values;
|
||||
});
|
||||
},
|
||||
properties: {
|
||||
actions: {
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
EntitySchema,
|
||||
EntityValues,
|
||||
EnumValueConfig,
|
||||
Properties,
|
||||
PropertiesOrBuilder,
|
||||
Property,
|
||||
PropertyOrBuilder
|
||||
@@ -73,12 +74,18 @@ export function buildProperty(
|
||||
* same properties
|
||||
* @param properties
|
||||
*/
|
||||
export function buildProperties<S extends EntitySchema<Key>, Key extends string>(
|
||||
properties: PropertiesOrBuilder<S, Key>
|
||||
): PropertiesOrBuilder<S, Key> {
|
||||
export function buildProperties<Key extends string>(
|
||||
properties: Properties<Key>
|
||||
): Properties<Key> {
|
||||
return properties;
|
||||
}
|
||||
|
||||
export function buildPropertiesOrBuilder<S extends EntitySchema<Key>, Key extends string>(
|
||||
propertiesOrBuilder: PropertiesOrBuilder<S, Key>
|
||||
): PropertiesOrBuilder<S, Key> {
|
||||
return propertiesOrBuilder;
|
||||
}
|
||||
|
||||
export function buildEnumValueConfig(
|
||||
enumValueConfig: EnumValueConfig
|
||||
): EnumValueConfig {
|
||||
|
||||
@@ -491,7 +491,7 @@ export type EnumValueConfig = {
|
||||
/**
|
||||
* Record of properties of an entity or a map property
|
||||
*/
|
||||
export type Properties<Key extends string, T extends any = any> = Record<Key, Property<T>>;
|
||||
export type Properties<Key extends string = string, T extends any = any> = Record<Key, Property<T>>;
|
||||
|
||||
export type PropertyBuilderProps<S extends EntitySchema<Key> = EntitySchema<any>, Key extends string = Extract<keyof S["properties"], string>> =
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user