@teleporthq/teleport-types
Advanced tools
Comparing version 0.35.0-alpha.0 to 0.35.0
@@ -1,2 +0,2 @@ | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources } from './uidl'; | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources, UIDLLocalFontAsset } from './uidl'; | ||
export declare enum FileType { | ||
@@ -56,3 +56,2 @@ CSS = "css", | ||
devDependencies: Record<string, string>; | ||
projectResources?: Record<string, ProjectResource>; | ||
strategy: ProjectStrategy; | ||
@@ -82,6 +81,2 @@ rootFolder: GeneratedFolder; | ||
} | ||
export interface ProjectResource { | ||
fileName: string; | ||
path: string; | ||
} | ||
export interface GeneratorOptions { | ||
@@ -93,2 +88,4 @@ localDependenciesPrefix?: string; | ||
mappings?: Record<string, string>; | ||
fontsFolder?: string; | ||
localFonts?: UIDLLocalFontAsset[]; | ||
}; | ||
@@ -108,3 +105,8 @@ mapping?: Mapping; | ||
}; | ||
projectResources?: Record<string, ProjectResource>; | ||
extractedResources?: Record<string, { | ||
fileName: string; | ||
fileType: FileType; | ||
path: string[]; | ||
content: string; | ||
}>; | ||
designLanguage?: { | ||
@@ -116,4 +118,3 @@ tokens?: UIDLDesignTokens; | ||
cache: UIDLResources['cache']; | ||
} & { | ||
path: ProjectStrategy['resources']['path']; | ||
path: string[]; | ||
}; | ||
@@ -144,3 +145,3 @@ } | ||
}) => void; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping) => Promise<GeneratedFolder>; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping, strictHtmlWhitespaceSensitivity?: boolean) => Promise<GeneratedFolder>; | ||
addMapping: (mapping: Mapping) => void; | ||
@@ -158,2 +159,3 @@ getAssetsPath: () => string[]; | ||
variation?: StyleVariation; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -164,4 +166,3 @@ export type ComponentGeneratorInstance = (params?: GeneratorFactoryParams) => ComponentGenerator; | ||
externals: Record<string, ComponentUIDL>; | ||
skipValidation?: boolean; | ||
assets?: GeneratorOptions['assets']; | ||
options: GeneratorOptions; | ||
}) => void; | ||
@@ -340,2 +341,3 @@ } | ||
readyState?: string; | ||
passwordProtection?: string; | ||
} | ||
@@ -410,2 +412,4 @@ export interface VercelDeleteProject { | ||
assetsFolder?: string[]; | ||
excludeGlobalsFromHTMLComponents?: boolean; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -415,2 +419,3 @@ export interface GenerateOptions { | ||
styleVariation?: StyleVariation; | ||
plugins?: ComponentPlugin[]; | ||
} | ||
@@ -455,3 +460,7 @@ export declare enum ReactStyleVariation { | ||
export type GenerateComponentFunction = (componentUIDL: ComponentUIDL, options: GenerateOptions) => Promise<CompiledComponent>; | ||
export type ElementsLookup = Record<string, { | ||
count: number; | ||
nextKey: string; | ||
}>; | ||
export {}; | ||
//# sourceMappingURL=generators.d.ts.map |
export type Modify<T, R> = Omit<T, keyof R> & R; | ||
export type ModifyUnionNumber<T, U, V> = T extends U ? V : T; | ||
//# sourceMappingURL=helper.d.ts.map |
@@ -43,4 +43,4 @@ import { Modify } from './helper'; | ||
method?: 'GET' | 'POST'; | ||
body?: Record<string, UIDLStaticValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue>; | ||
body?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue>; | ||
mappers?: string[]; | ||
@@ -124,2 +124,7 @@ response?: { | ||
} | ||
export interface UIDLLocalFontAsset { | ||
type: 'local-font'; | ||
path: string; | ||
properties: Record<string, UIDLStaticValue>; | ||
} | ||
export interface UIDLCanonicalAsset { | ||
@@ -137,3 +142,3 @@ type: 'canonical'; | ||
} | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset; | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset | UIDLLocalFontAsset; | ||
export interface ComponentUIDL { | ||
@@ -157,6 +162,12 @@ name: string; | ||
name: string; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
}; | ||
resource: UIDLResourceLink; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
cache?: { | ||
@@ -172,3 +183,10 @@ revalidate: number; | ||
}; | ||
resource: UIDLResourceLink; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
} | ||
@@ -183,3 +201,2 @@ export interface UIDLComponentOutputOptions { | ||
pagination?: PagePaginationOptions; | ||
dynamicRouteAttribute?: string; | ||
initialPropsData?: UIDLInitialPropsData; | ||
@@ -196,3 +213,3 @@ initialPathsData?: UIDLInitialPathsData; | ||
type: string; | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void); | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | UIDLElementNode; | ||
isRequired?: boolean; | ||
@@ -226,4 +243,2 @@ id?: string; | ||
fallback?: boolean; | ||
dynamicRouteAttribute?: string; | ||
isIndex?: boolean; | ||
pagination?: PagePaginationOptions; | ||
@@ -240,2 +255,3 @@ initialPropsData?: UIDLInitialPropsData; | ||
referenceType: ReferenceType; | ||
refPath?: string[]; | ||
id: string; | ||
@@ -276,2 +292,18 @@ }; | ||
} | ||
export interface UIDLCMSMixedTypeNode { | ||
type: 'cms-mixed-type'; | ||
content: { | ||
elementType: string; | ||
name: string; | ||
key: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
nodes: { | ||
fallback?: UIDLElementNode; | ||
error?: UIDLElementNode; | ||
}; | ||
mappings?: Record<string, UIDLElementNode>; | ||
}; | ||
} | ||
export interface UIDLCMSListRepeaterNode { | ||
@@ -284,3 +316,3 @@ type: 'cms-list-repeater'; | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
@@ -290,7 +322,7 @@ export interface UIDLExternalResource { | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
export interface UIDLCMSListNodeContent { | ||
elementType: string; | ||
name: string; | ||
name?: string; | ||
key: string; | ||
@@ -306,5 +338,4 @@ attrs?: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
valuePath?: string[]; | ||
valuePath: string[]; | ||
paginationQueryParam?: UIDLStaticValue | UIDLPropValue | UIDLExpressionValue; | ||
itemValuePath?: string[]; | ||
resource?: UIDLResourceLink; | ||
@@ -326,6 +357,6 @@ initialData?: UIDLPropValue; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLResourceLink; | ||
initialData?: UIDLPropValue; | ||
entityKeyProperty?: string; | ||
} | ||
@@ -336,2 +367,3 @@ export interface UIDLCMSListRepeaterNodeContent { | ||
key: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -342,2 +374,3 @@ list: UIDLElementNode; | ||
renderPropIdentifier: string; | ||
source?: string; | ||
} | ||
@@ -354,3 +387,3 @@ export interface UIDLNestedStyleDeclaration { | ||
node: UIDLElementNode; | ||
dataSource: UIDLAttributeValue; | ||
dataSource: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
meta?: UIDLRepeatMeta; | ||
@@ -368,3 +401,3 @@ } | ||
node: UIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
importDefinitions?: Record<string, UIDLExternalDependency>; | ||
@@ -405,5 +438,4 @@ value?: string | number | boolean; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
} | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode; | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode | UIDLCMSMixedTypeNode; | ||
export interface UIDLComponentStyleReference { | ||
@@ -413,3 +445,3 @@ type: 'comp-style'; | ||
} | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue | UIDLElementNode; | ||
export type UIDLStyleValue = UIDLDynamicReference | UIDLStaticValue; | ||
@@ -427,3 +459,3 @@ export type UIDLStyleDefinitions = Record<string, UIDLStyleValue>; | ||
content: { | ||
url: UIDLAttributeValue; | ||
url: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
newTab: boolean; | ||
@@ -436,3 +468,3 @@ }; | ||
content: { | ||
section: string; | ||
section: UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
@@ -443,3 +475,3 @@ } | ||
content: { | ||
routeName: UIDLAttributeValue; | ||
routeName: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
}; | ||
@@ -446,0 +478,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLLocalResource, UIDLExternalResource, UIDLInjectValue, UIDLStateValueDetails, UIDLRouteDefinitions, UIDLStateDefinition } from './uidl'; | ||
import { Modify } from './helper'; | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLLocalResource, UIDLExternalResource, UIDLInjectValue, UIDLStateValueDetails, UIDLStateDefinition, UIDLCMSMixedTypeNode, UIDLDependency, UIDLLocalFontAsset, UIDLStyleValue, UIDLPropDefinition, UIDLExternalDependency } from './uidl'; | ||
import { Modify, ModifyUnionNumber } from './helper'; | ||
export interface VUIDLElementNode extends Modify<UIDLElementNode, { | ||
@@ -19,4 +19,3 @@ content: VUIDLElement; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
@@ -38,3 +37,5 @@ initialData?: UIDLPropValue; | ||
content: { | ||
elementType: string; | ||
name?: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -46,4 +47,3 @@ key?: string; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
@@ -54,7 +54,23 @@ initialData?: UIDLPropValue; | ||
} | ||
export interface VUIDLCMSMixedTypeNode extends Modify<UIDLCMSMixedTypeNode, { | ||
content: { | ||
elementType: string; | ||
name: string; | ||
nodes: { | ||
fallback?: VUIDLElementNode; | ||
error?: VUIDLElementNode; | ||
}; | ||
renderPropIdentifier: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, VUIDLAttributeValue | string | number>; | ||
mappings: Record<string, VUIDLElementNode>; | ||
}; | ||
}> { | ||
} | ||
export type VUIDLConditionalNode = Modify<UIDLConditionalNode, { | ||
content: { | ||
node: VUIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
value?: string | number | boolean; | ||
importDefinitions?: Record<string, UIDLExternalDependency>; | ||
condition?: UIDLConditionalExpression; | ||
@@ -66,14 +82,20 @@ }; | ||
node: VUIDLElementNode; | ||
dataSource?: UIDLAttributeValue; | ||
dataSource?: UIDLRepeatNode['content']['dataSource']; | ||
meta?: UIDLRepeatMeta; | ||
}; | ||
}>; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | VUIDLCMSMixedTypeNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLElement = Modify<UIDLElement, { | ||
elementType: string; | ||
semanticType?: string; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
abilities?: { | ||
link?: VUIDLLinkNode; | ||
}; | ||
events: UIDLElement['events']; | ||
dependency?: UIDLDependency; | ||
children?: VUIDLNode[]; | ||
style?: Record<string, UIDLAttributeValue | string | number>; | ||
attrs?: Record<string, UIDLAttributeValue | string | number>; | ||
style?: Record<string, UIDLStyleValue | string | number>; | ||
attrs?: Record<string, VUIDLAttributeValue | string | number>; | ||
referencedStyles: Record<string, UIDLElementNodeProjectReferencedStyle | VUIDLElementNodeInlineReferencedStyle | VUIDLElementNodeClassReferencedStyle>; | ||
@@ -85,3 +107,3 @@ }>; | ||
conditions: UIDLStyleConditions[]; | ||
styles: Record<string, UIDLAttributeValue | string | number>; | ||
styles: Record<string, UIDLStyleValue | string | number>; | ||
}; | ||
@@ -104,7 +126,11 @@ }>; | ||
node: VUIDLElementNode; | ||
stateDefinitions: { | ||
route: Modify<UIDLRouteDefinitions, { | ||
stateDefinitions?: { | ||
route: { | ||
type: string; | ||
defaultValue: string; | ||
values: VUIDLStateValueDetails[]; | ||
}>; | ||
[x: string]: UIDLStateDefinition; | ||
}; | ||
[x: string]: UIDLStateDefinition & { | ||
values?: VUIDLStateValueDetails[]; | ||
}; | ||
}; | ||
@@ -132,7 +158,9 @@ designLanguage: { | ||
export type VUIDLSectionLinkNode = Modify<UIDLSectionLinkNode, { | ||
content: Record<string, string>; | ||
content: { | ||
section: string | UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
}>; | ||
export type VUIDLURLLinkNode = Modify<UIDLURLLinkNode, { | ||
content: { | ||
url: UIDLAttributeValue | string; | ||
url: UIDLURLLinkNode['content']['url'] | string; | ||
newTab: boolean; | ||
@@ -143,3 +171,3 @@ }; | ||
content: { | ||
routeName: string | UIDLAttributeValue; | ||
routeName: string | UIDLNavLinkNode['content']['routeName']; | ||
}; | ||
@@ -156,3 +184,3 @@ }>; | ||
export type VUIDLLinkNode = VUIDLURLLinkNode | VUIDLSectionLinkNode | VUIDLNavLinkNode | UIDLMailLinkNode | UIDLPhoneLinkNode | VUIDLDynamicLinkNode; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset | UIDLLocalFontAsset; | ||
export type VUIDLStyleInlineAsset = Modify<UIDLStyleInlineAsset, { | ||
@@ -173,2 +201,6 @@ attrs?: Record<string, UIDLStaticValue | string | boolean | number>; | ||
}>; | ||
export type VUIDLAttributeValue = ModifyUnionNumber<UIDLAttributeValue, UIDLElementNode, VUIDLElementNode>; | ||
export type VUIDLPropDefinitions = Modify<UIDLPropDefinition, { | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | VUIDLElementNode; | ||
}>; | ||
//# sourceMappingURL=vuidl.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources } from './uidl'; | ||
import { ComponentUIDL, ProjectUIDL, UIDLDependency, Mapping, UIDLElement, UIDLStyleSetDefinition, UIDLDesignTokens, UIDLRootComponent, UIDLRouteDefinitions, UIDLPageOptions, UIDLResources, UIDLLocalFontAsset } from './uidl'; | ||
export declare enum FileType { | ||
@@ -56,3 +56,2 @@ CSS = "css", | ||
devDependencies: Record<string, string>; | ||
projectResources?: Record<string, ProjectResource>; | ||
strategy: ProjectStrategy; | ||
@@ -82,6 +81,2 @@ rootFolder: GeneratedFolder; | ||
} | ||
export interface ProjectResource { | ||
fileName: string; | ||
path: string; | ||
} | ||
export interface GeneratorOptions { | ||
@@ -93,2 +88,4 @@ localDependenciesPrefix?: string; | ||
mappings?: Record<string, string>; | ||
fontsFolder?: string; | ||
localFonts?: UIDLLocalFontAsset[]; | ||
}; | ||
@@ -108,3 +105,8 @@ mapping?: Mapping; | ||
}; | ||
projectResources?: Record<string, ProjectResource>; | ||
extractedResources?: Record<string, { | ||
fileName: string; | ||
fileType: FileType; | ||
path: string[]; | ||
content: string; | ||
}>; | ||
designLanguage?: { | ||
@@ -116,4 +118,3 @@ tokens?: UIDLDesignTokens; | ||
cache: UIDLResources['cache']; | ||
} & { | ||
path: ProjectStrategy['resources']['path']; | ||
path: string[]; | ||
}; | ||
@@ -144,3 +145,3 @@ } | ||
}) => void; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping) => Promise<GeneratedFolder>; | ||
generateProject: (input: ProjectUIDL | Record<string, unknown>, template?: GeneratedFolder, mapping?: Mapping, strictHtmlWhitespaceSensitivity?: boolean) => Promise<GeneratedFolder>; | ||
addMapping: (mapping: Mapping) => void; | ||
@@ -158,2 +159,3 @@ getAssetsPath: () => string[]; | ||
variation?: StyleVariation; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -164,4 +166,3 @@ export type ComponentGeneratorInstance = (params?: GeneratorFactoryParams) => ComponentGenerator; | ||
externals: Record<string, ComponentUIDL>; | ||
skipValidation?: boolean; | ||
assets?: GeneratorOptions['assets']; | ||
options: GeneratorOptions; | ||
}) => void; | ||
@@ -340,2 +341,3 @@ } | ||
readyState?: string; | ||
passwordProtection?: string; | ||
} | ||
@@ -410,2 +412,4 @@ export interface VercelDeleteProject { | ||
assetsFolder?: string[]; | ||
excludeGlobalsFromHTMLComponents?: boolean; | ||
strictHtmlWhitespaceSensitivity?: boolean; | ||
} | ||
@@ -415,2 +419,3 @@ export interface GenerateOptions { | ||
styleVariation?: StyleVariation; | ||
plugins?: ComponentPlugin[]; | ||
} | ||
@@ -455,3 +460,7 @@ export declare enum ReactStyleVariation { | ||
export type GenerateComponentFunction = (componentUIDL: ComponentUIDL, options: GenerateOptions) => Promise<CompiledComponent>; | ||
export type ElementsLookup = Record<string, { | ||
count: number; | ||
nextKey: string; | ||
}>; | ||
export {}; | ||
//# sourceMappingURL=generators.d.ts.map |
export type Modify<T, R> = Omit<T, keyof R> & R; | ||
export type ModifyUnionNumber<T, U, V> = T extends U ? V : T; | ||
//# sourceMappingURL=helper.d.ts.map |
@@ -43,4 +43,4 @@ import { Modify } from './helper'; | ||
method?: 'GET' | 'POST'; | ||
body?: Record<string, UIDLStaticValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue>; | ||
body?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue>; | ||
mappers?: string[]; | ||
@@ -124,2 +124,7 @@ response?: { | ||
} | ||
export interface UIDLLocalFontAsset { | ||
type: 'local-font'; | ||
path: string; | ||
properties: Record<string, UIDLStaticValue>; | ||
} | ||
export interface UIDLCanonicalAsset { | ||
@@ -137,3 +142,3 @@ type: 'canonical'; | ||
} | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset; | ||
export type UIDLGlobalAsset = UIDLScriptAsset | UIDLStyleInlineAsset | UIDLStyleExternalAsset | UIDLFontAsset | UIDLCanonicalAsset | UIDLIconAsset | UIDLLocalFontAsset; | ||
export interface ComponentUIDL { | ||
@@ -157,6 +162,12 @@ name: string; | ||
name: string; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
}; | ||
resource: UIDLResourceLink; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
cache?: { | ||
@@ -172,3 +183,10 @@ revalidate: number; | ||
}; | ||
resource: UIDLResourceLink; | ||
resource: { | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
} | { | ||
name: string; | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue>; | ||
}; | ||
} | ||
@@ -183,3 +201,2 @@ export interface UIDLComponentOutputOptions { | ||
pagination?: PagePaginationOptions; | ||
dynamicRouteAttribute?: string; | ||
initialPropsData?: UIDLInitialPropsData; | ||
@@ -196,3 +213,3 @@ initialPathsData?: UIDLInitialPathsData; | ||
type: string; | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void); | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | UIDLElementNode; | ||
isRequired?: boolean; | ||
@@ -226,4 +243,2 @@ id?: string; | ||
fallback?: boolean; | ||
dynamicRouteAttribute?: string; | ||
isIndex?: boolean; | ||
pagination?: PagePaginationOptions; | ||
@@ -240,2 +255,3 @@ initialPropsData?: UIDLInitialPropsData; | ||
referenceType: ReferenceType; | ||
refPath?: string[]; | ||
id: string; | ||
@@ -276,2 +292,18 @@ }; | ||
} | ||
export interface UIDLCMSMixedTypeNode { | ||
type: 'cms-mixed-type'; | ||
content: { | ||
elementType: string; | ||
name: string; | ||
key: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
nodes: { | ||
fallback?: UIDLElementNode; | ||
error?: UIDLElementNode; | ||
}; | ||
mappings?: Record<string, UIDLElementNode>; | ||
}; | ||
} | ||
export interface UIDLCMSListRepeaterNode { | ||
@@ -284,3 +316,3 @@ type: 'cms-list-repeater'; | ||
id: string; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
@@ -290,7 +322,7 @@ export interface UIDLExternalResource { | ||
dependency: UIDLExternalDependency; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue>; | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue>; | ||
} | ||
export interface UIDLCMSListNodeContent { | ||
elementType: string; | ||
name: string; | ||
name?: string; | ||
key: string; | ||
@@ -306,5 +338,4 @@ attrs?: Record<string, UIDLAttributeValue>; | ||
renderPropIdentifier: string; | ||
valuePath?: string[]; | ||
valuePath: string[]; | ||
paginationQueryParam?: UIDLStaticValue | UIDLPropValue | UIDLExpressionValue; | ||
itemValuePath?: string[]; | ||
resource?: UIDLResourceLink; | ||
@@ -326,6 +357,6 @@ initialData?: UIDLPropValue; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLResourceLink; | ||
initialData?: UIDLPropValue; | ||
entityKeyProperty?: string; | ||
} | ||
@@ -336,2 +367,3 @@ export interface UIDLCMSListRepeaterNodeContent { | ||
key: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -342,2 +374,3 @@ list: UIDLElementNode; | ||
renderPropIdentifier: string; | ||
source?: string; | ||
} | ||
@@ -354,3 +387,3 @@ export interface UIDLNestedStyleDeclaration { | ||
node: UIDLElementNode; | ||
dataSource: UIDLAttributeValue; | ||
dataSource: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
meta?: UIDLRepeatMeta; | ||
@@ -368,3 +401,3 @@ } | ||
node: UIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
importDefinitions?: Record<string, UIDLExternalDependency>; | ||
@@ -405,5 +438,4 @@ value?: string | number | boolean; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
} | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode; | ||
export type UIDLNode = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | UIDLInjectValue | UIDLRepeatNode | UIDLElementNode | UIDLConditionalNode | UIDLSlotNode | UIDLImportReference | UIDLCMSListNode | UIDLCMSItemNode | UIDLDateTimeNode | UIDLCMSListRepeaterNode | UIDLCMSMixedTypeNode; | ||
export interface UIDLComponentStyleReference { | ||
@@ -413,3 +445,3 @@ type: 'comp-style'; | ||
} | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
export type UIDLAttributeValue = UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue | UIDLElementNode; | ||
export type UIDLStyleValue = UIDLDynamicReference | UIDLStaticValue; | ||
@@ -427,3 +459,3 @@ export type UIDLStyleDefinitions = Record<string, UIDLStyleValue>; | ||
content: { | ||
url: UIDLAttributeValue; | ||
url: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
newTab: boolean; | ||
@@ -436,3 +468,3 @@ }; | ||
content: { | ||
section: string; | ||
section: UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
@@ -443,3 +475,3 @@ } | ||
content: { | ||
routeName: UIDLAttributeValue; | ||
routeName: UIDLExpressionValue | UIDLDynamicReference | UIDLStaticValue | UIDLImportReference | UIDLComponentStyleReference | UIDLRawValue; | ||
}; | ||
@@ -446,0 +478,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLLocalResource, UIDLExternalResource, UIDLInjectValue, UIDLStateValueDetails, UIDLRouteDefinitions, UIDLStateDefinition } from './uidl'; | ||
import { Modify } from './helper'; | ||
import { UIDLElement, UIDLElementNode, UIDLAttributeValue, ComponentUIDL, UIDLStaticValue, UIDLStyleSetDefinition, ProjectUIDL, UIDLSlotNode, UIDLDynamicReference, UIDLRawValue, UIDLRepeatNode, UIDLConditionalNode, UIDLRepeatMeta, UIDLConditionalExpression, UIDLElementNodeInlineReferencedStyle, UIDLStyleConditions, UIDLElementNodeProjectReferencedStyle, UIDLSectionLinkNode, UIDLURLLinkNode, UIDLNavLinkNode, UIDLMailLinkNode, UIDLPhoneLinkNode, UIDLStyleSetMediaCondition, UIDLStyleSetStateCondition, UIDLStyleSetTokenReference, UIDLElementNodeCompReferencedStyle, UIDLCompDynamicReference, UIDLStyleInlineAsset, UIDLFontAsset, UIDLComponentSEO, UIDLGlobalProjectValues, UIDLScriptAsset, UIDLStyleExternalAsset, UIDLCanonicalAsset, UIDLIconAsset, UIDLRootComponent, UIDLCMSItemNode, UIDLCMSListNode, UIDLCMSListRepeaterNode, UIDLDynamicLinkNode, UIDLPropValue, UIDLExpressionValue, UIDLDateTimeNode, UIDLLocalResource, UIDLExternalResource, UIDLInjectValue, UIDLStateValueDetails, UIDLStateDefinition, UIDLCMSMixedTypeNode, UIDLDependency, UIDLLocalFontAsset, UIDLStyleValue, UIDLPropDefinition, UIDLExternalDependency } from './uidl'; | ||
import { Modify, ModifyUnionNumber } from './helper'; | ||
export interface VUIDLElementNode extends Modify<UIDLElementNode, { | ||
@@ -19,4 +19,3 @@ content: VUIDLElement; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
@@ -38,3 +37,5 @@ initialData?: UIDLPropValue; | ||
content: { | ||
elementType: string; | ||
name?: string; | ||
dependency?: UIDLDependency; | ||
nodes: { | ||
@@ -46,4 +47,3 @@ key?: string; | ||
}; | ||
valuePath?: string[]; | ||
itemValuePath?: string[]; | ||
valuePath: string[]; | ||
resource?: UIDLLocalResource | UIDLExternalResource; | ||
@@ -54,7 +54,23 @@ initialData?: UIDLPropValue; | ||
} | ||
export interface VUIDLCMSMixedTypeNode extends Modify<UIDLCMSMixedTypeNode, { | ||
content: { | ||
elementType: string; | ||
name: string; | ||
nodes: { | ||
fallback?: VUIDLElementNode; | ||
error?: VUIDLElementNode; | ||
}; | ||
renderPropIdentifier: string; | ||
dependency?: UIDLDependency; | ||
attrs: Record<string, VUIDLAttributeValue | string | number>; | ||
mappings: Record<string, VUIDLElementNode>; | ||
}; | ||
}> { | ||
} | ||
export type VUIDLConditionalNode = Modify<UIDLConditionalNode, { | ||
content: { | ||
node: VUIDLNode; | ||
reference: UIDLDynamicReference; | ||
reference: UIDLDynamicReference | UIDLExpressionValue; | ||
value?: string | number | boolean; | ||
importDefinitions?: Record<string, UIDLExternalDependency>; | ||
condition?: UIDLConditionalExpression; | ||
@@ -66,14 +82,20 @@ }; | ||
node: VUIDLElementNode; | ||
dataSource?: UIDLAttributeValue; | ||
dataSource?: UIDLRepeatNode['content']['dataSource']; | ||
meta?: UIDLRepeatMeta; | ||
}; | ||
}>; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLNode = UIDLDynamicReference | UIDLStaticValue | UIDLRawValue | VUIDLDateTimeNode | VUIDLElementNode | VUIDLRepeatNode | VUIDLConditionalNode | VUIDLSlotNode | VCMSItemUIDLElementNode | VCMSListUIDLElementNode | VCMSListRepeaterElementNode | VUIDLCMSMixedTypeNode | UIDLExpressionValue | UIDLInjectValue | string; | ||
export type VUIDLElement = Modify<UIDLElement, { | ||
elementType: string; | ||
semanticType?: string; | ||
selfClosing?: boolean; | ||
ignore?: boolean; | ||
abilities?: { | ||
link?: VUIDLLinkNode; | ||
}; | ||
events: UIDLElement['events']; | ||
dependency?: UIDLDependency; | ||
children?: VUIDLNode[]; | ||
style?: Record<string, UIDLAttributeValue | string | number>; | ||
attrs?: Record<string, UIDLAttributeValue | string | number>; | ||
style?: Record<string, UIDLStyleValue | string | number>; | ||
attrs?: Record<string, VUIDLAttributeValue | string | number>; | ||
referencedStyles: Record<string, UIDLElementNodeProjectReferencedStyle | VUIDLElementNodeInlineReferencedStyle | VUIDLElementNodeClassReferencedStyle>; | ||
@@ -85,3 +107,3 @@ }>; | ||
conditions: UIDLStyleConditions[]; | ||
styles: Record<string, UIDLAttributeValue | string | number>; | ||
styles: Record<string, UIDLStyleValue | string | number>; | ||
}; | ||
@@ -104,7 +126,11 @@ }>; | ||
node: VUIDLElementNode; | ||
stateDefinitions: { | ||
route: Modify<UIDLRouteDefinitions, { | ||
stateDefinitions?: { | ||
route: { | ||
type: string; | ||
defaultValue: string; | ||
values: VUIDLStateValueDetails[]; | ||
}>; | ||
[x: string]: UIDLStateDefinition; | ||
}; | ||
[x: string]: UIDLStateDefinition & { | ||
values?: VUIDLStateValueDetails[]; | ||
}; | ||
}; | ||
@@ -132,7 +158,9 @@ designLanguage: { | ||
export type VUIDLSectionLinkNode = Modify<UIDLSectionLinkNode, { | ||
content: Record<string, string>; | ||
content: { | ||
section: string | UIDLStaticValue | UIDLExpressionValue; | ||
}; | ||
}>; | ||
export type VUIDLURLLinkNode = Modify<UIDLURLLinkNode, { | ||
content: { | ||
url: UIDLAttributeValue | string; | ||
url: UIDLURLLinkNode['content']['url'] | string; | ||
newTab: boolean; | ||
@@ -143,3 +171,3 @@ }; | ||
content: { | ||
routeName: string | UIDLAttributeValue; | ||
routeName: string | UIDLNavLinkNode['content']['routeName']; | ||
}; | ||
@@ -156,3 +184,3 @@ }>; | ||
export type VUIDLLinkNode = VUIDLURLLinkNode | VUIDLSectionLinkNode | VUIDLNavLinkNode | UIDLMailLinkNode | UIDLPhoneLinkNode | VUIDLDynamicLinkNode; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset; | ||
export type VUIDLGlobalAsset = UIDLScriptAsset | UIDLStyleExternalAsset | UIDLCanonicalAsset | UIDLIconAsset | VUIDLStyleInlineAsset | VUIDLFontAsset | UIDLLocalFontAsset; | ||
export type VUIDLStyleInlineAsset = Modify<UIDLStyleInlineAsset, { | ||
@@ -173,2 +201,6 @@ attrs?: Record<string, UIDLStaticValue | string | boolean | number>; | ||
}>; | ||
export type VUIDLAttributeValue = ModifyUnionNumber<UIDLAttributeValue, UIDLElementNode, VUIDLElementNode>; | ||
export type VUIDLPropDefinitions = Modify<UIDLPropDefinition, { | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | VUIDLElementNode; | ||
}>; | ||
//# sourceMappingURL=vuidl.d.ts.map |
{ | ||
"name": "@teleporthq/teleport-types", | ||
"version": "0.35.0-alpha.0", | ||
"version": "0.35.0", | ||
"description": "The collection of reusable types across the entire teleport ecosystem", | ||
@@ -26,3 +26,3 @@ "author": "teleportHQ", | ||
}, | ||
"gitHead": "e8ce842bf620a51081ff6f1cdf95b276325c19d2" | ||
"gitHead": "ae4ff86d5380c1d74575847a2b91c863713c1d8e" | ||
} |
@@ -13,2 +13,3 @@ import { | ||
UIDLResources, | ||
UIDLLocalFontAsset, | ||
} from './uidl' | ||
@@ -77,3 +78,2 @@ | ||
devDependencies: Record<string, string> | ||
projectResources?: Record<string, ProjectResource> | ||
strategy: ProjectStrategy | ||
@@ -115,7 +115,2 @@ rootFolder: GeneratedFolder | ||
export interface ProjectResource { | ||
fileName: string | ||
path: string | ||
} | ||
export interface GeneratorOptions { | ||
@@ -127,2 +122,4 @@ localDependenciesPrefix?: string | ||
mappings?: Record<string, string> | ||
fontsFolder?: string | ||
localFonts?: UIDLLocalFontAsset[] | ||
} | ||
@@ -142,9 +139,15 @@ mapping?: Mapping | ||
} | ||
projectResources?: Record<string, ProjectResource> | ||
extractedResources?: Record< | ||
string, | ||
{ | ||
fileName: string | ||
fileType: FileType | ||
path: string[] | ||
content: string | ||
} | ||
> | ||
designLanguage?: { | ||
tokens?: UIDLDesignTokens | ||
} | ||
resources?: { items: UIDLResources['items']; cache: UIDLResources['cache'] } & { | ||
path: ProjectStrategy['resources']['path'] | ||
} | ||
resources?: { items: UIDLResources['items']; cache: UIDLResources['cache']; path: string[] } | ||
} | ||
@@ -184,3 +187,4 @@ | ||
template?: GeneratedFolder, | ||
mapping?: Mapping | ||
mapping?: Mapping, | ||
strictHtmlWhitespaceSensitivity?: boolean | ||
) => Promise<GeneratedFolder> | ||
@@ -200,2 +204,3 @@ addMapping: (mapping: Mapping) => void | ||
variation?: StyleVariation | ||
strictHtmlWhitespaceSensitivity?: boolean | ||
} | ||
@@ -208,4 +213,3 @@ | ||
externals: Record<string, ComponentUIDL> | ||
skipValidation?: boolean | ||
assets?: GeneratorOptions['assets'] | ||
options: GeneratorOptions | ||
}) => void | ||
@@ -407,2 +411,3 @@ } | ||
readyState?: string | ||
passwordProtection?: string | ||
} | ||
@@ -489,2 +494,4 @@ | ||
assetsFolder?: string[] | ||
excludeGlobalsFromHTMLComponents?: boolean | ||
strictHtmlWhitespaceSensitivity?: boolean | ||
} | ||
@@ -495,2 +502,3 @@ | ||
styleVariation?: StyleVariation | ||
plugins?: ComponentPlugin[] | ||
} | ||
@@ -557,1 +565,3 @@ | ||
) => Promise<CompiledComponent> | ||
export type ElementsLookup = Record<string, { count: number; nextKey: string }> |
export type Modify<T, R> = Omit<T, keyof R> & R | ||
export type ModifyUnionNumber<T, U, V> = T extends U ? V : T |
108
src/uidl.ts
@@ -53,4 +53,4 @@ import { Modify } from './helper' | ||
method?: 'GET' | 'POST' | ||
body?: Record<string, UIDLStaticValue> | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue> | ||
body?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLStateValue | UIDLExpressionValue> | ||
mappers?: string[] | ||
@@ -145,2 +145,9 @@ response?: { | ||
} | ||
export interface UIDLLocalFontAsset { | ||
type: 'local-font' | ||
path: string | ||
properties: Record<string, UIDLStaticValue> | ||
} | ||
export interface UIDLCanonicalAsset { | ||
@@ -150,2 +157,3 @@ type: 'canonical' | ||
} | ||
export interface UIDLIconAsset { | ||
@@ -167,2 +175,3 @@ type: 'icon' | ||
| UIDLIconAsset | ||
| UIDLLocalFontAsset | ||
@@ -185,9 +194,18 @@ export interface ComponentUIDL { | ||
export type UIDLDesignTokens = Record<string, UIDLStaticValue> | ||
export interface UIDLInitialPropsData { | ||
exposeAs: { | ||
name: string | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
valuePath: string[] | ||
} | ||
resource: UIDLResourceLink | ||
resource: | ||
| { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
| { | ||
name: string | ||
dependency: UIDLExternalDependency | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
/* | ||
@@ -214,3 +232,12 @@ We allow the configuration of cache strategy globally for the whole project under | ||
} | ||
resource: UIDLResourceLink | ||
resource: | ||
| { | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
| { | ||
name: string | ||
dependency: UIDLExternalDependency | ||
params?: Record<string, UIDLStaticValue | UIDLExpressionValue> | ||
} | ||
} | ||
@@ -226,3 +253,2 @@ | ||
pagination?: PagePaginationOptions | ||
dynamicRouteAttribute?: string | ||
initialPropsData?: UIDLInitialPropsData | ||
@@ -242,3 +268,3 @@ initialPathsData?: UIDLInitialPathsData | ||
type: string | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | UIDLElementNode | ||
isRequired?: boolean | ||
@@ -277,4 +303,2 @@ id?: string | ||
fallback?: boolean | ||
dynamicRouteAttribute?: string | ||
isIndex?: boolean | ||
pagination?: PagePaginationOptions | ||
@@ -293,2 +317,3 @@ initialPropsData?: UIDLInitialPropsData | ||
referenceType: ReferenceType | ||
refPath?: string[] | ||
id: string | ||
@@ -337,2 +362,19 @@ } | ||
export interface UIDLCMSMixedTypeNode { | ||
type: 'cms-mixed-type' | ||
content: { | ||
elementType: string | ||
name: string | ||
key: string | ||
dependency?: UIDLDependency | ||
attrs: Record<string, UIDLAttributeValue> | ||
renderPropIdentifier: string | ||
nodes: { | ||
fallback?: UIDLElementNode | ||
error?: UIDLElementNode | ||
} | ||
mappings?: Record<string, UIDLElementNode> | ||
} | ||
} | ||
export interface UIDLCMSListRepeaterNode { | ||
@@ -353,3 +395,3 @@ type: 'cms-list-repeater' | ||
id: string | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue> | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue> | ||
} | ||
@@ -360,3 +402,3 @@ | ||
dependency: UIDLExternalDependency | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue> | ||
params?: Record<string, UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | UIDLStateValue> | ||
} | ||
@@ -366,3 +408,3 @@ | ||
elementType: string | ||
name: string | ||
name?: string | ||
key: string // internal usage | ||
@@ -378,5 +420,4 @@ attrs?: Record<string, UIDLAttributeValue> | ||
renderPropIdentifier: string | ||
valuePath?: string[] | ||
valuePath: string[] | ||
paginationQueryParam?: UIDLStaticValue | UIDLPropValue | UIDLExpressionValue | ||
itemValuePath?: string[] | ||
resource?: UIDLResourceLink | ||
@@ -399,6 +440,6 @@ initialData?: UIDLPropValue | ||
} | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
valuePath: string[] | ||
resource?: UIDLResourceLink | ||
initialData?: UIDLPropValue | ||
entityKeyProperty?: string | ||
} | ||
@@ -410,2 +451,3 @@ | ||
key: string // internal usage | ||
dependency?: UIDLDependency | ||
nodes: { | ||
@@ -416,2 +458,3 @@ list: UIDLElementNode | ||
renderPropIdentifier: string | ||
source?: string | ||
} | ||
@@ -431,3 +474,9 @@ | ||
node: UIDLElementNode | ||
dataSource: UIDLAttributeValue | ||
dataSource: | ||
| UIDLExpressionValue | ||
| UIDLDynamicReference | ||
| UIDLStaticValue | ||
| UIDLImportReference | ||
| UIDLComponentStyleReference | ||
| UIDLRawValue | ||
meta?: UIDLRepeatMeta | ||
@@ -447,3 +496,3 @@ } | ||
node: UIDLNode | ||
reference: UIDLDynamicReference | ||
reference: UIDLDynamicReference | UIDLExpressionValue | ||
importDefinitions?: Record<string, UIDLExternalDependency> | ||
@@ -489,3 +538,2 @@ value?: string | number | boolean | ||
selfClosing?: boolean | ||
ignore?: boolean | ||
} | ||
@@ -508,2 +556,3 @@ | ||
| UIDLCMSListRepeaterNode | ||
| UIDLCMSMixedTypeNode | ||
@@ -522,2 +571,3 @@ export interface UIDLComponentStyleReference { | ||
| UIDLRawValue | ||
| UIDLElementNode | ||
@@ -540,3 +590,9 @@ export type UIDLStyleValue = UIDLDynamicReference | UIDLStaticValue | ||
content: { | ||
url: UIDLAttributeValue | ||
url: | ||
| UIDLExpressionValue | ||
| UIDLDynamicReference | ||
| UIDLStaticValue | ||
| UIDLImportReference | ||
| UIDLComponentStyleReference | ||
| UIDLRawValue | ||
newTab: boolean | ||
@@ -553,3 +609,3 @@ } | ||
type: 'section' | ||
content: { section: string } | ||
content: { section: UIDLStaticValue | UIDLExpressionValue } | ||
} | ||
@@ -560,3 +616,9 @@ | ||
content: { | ||
routeName: UIDLAttributeValue | ||
routeName: | ||
| UIDLExpressionValue | ||
| UIDLDynamicReference | ||
| UIDLStaticValue | ||
| UIDLImportReference | ||
| UIDLComponentStyleReference | ||
| UIDLRawValue | ||
} | ||
@@ -563,0 +625,0 @@ } |
@@ -49,6 +49,11 @@ import { | ||
UIDLStateValueDetails, | ||
UIDLRouteDefinitions, | ||
UIDLStateDefinition, | ||
UIDLCMSMixedTypeNode, | ||
UIDLDependency, | ||
UIDLLocalFontAsset, | ||
UIDLStyleValue, | ||
UIDLPropDefinition, | ||
UIDLExternalDependency, | ||
} from './uidl' | ||
import { Modify } from './helper' | ||
import { Modify, ModifyUnionNumber } from './helper' | ||
@@ -70,4 +75,3 @@ export interface VUIDLElementNode extends Modify<UIDLElementNode, { content: VUIDLElement }> {} | ||
} | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
valuePath: string[] | ||
resource?: UIDLLocalResource | UIDLExternalResource | ||
@@ -97,3 +101,5 @@ initialData?: UIDLPropValue | ||
content: { | ||
elementType: string | ||
name?: string | ||
dependency?: UIDLDependency | ||
nodes: { | ||
@@ -105,4 +111,3 @@ key?: string | ||
} | ||
valuePath?: string[] | ||
itemValuePath?: string[] | ||
valuePath: string[] | ||
resource?: UIDLLocalResource | UIDLExternalResource | ||
@@ -114,2 +119,21 @@ initialData?: UIDLPropValue | ||
export interface VUIDLCMSMixedTypeNode | ||
extends Modify< | ||
UIDLCMSMixedTypeNode, | ||
{ | ||
content: { | ||
elementType: string | ||
name: string | ||
nodes: { | ||
fallback?: VUIDLElementNode | ||
error?: VUIDLElementNode | ||
} | ||
renderPropIdentifier: string | ||
dependency?: UIDLDependency | ||
attrs: Record<string, VUIDLAttributeValue | string | number> | ||
mappings: Record<string, VUIDLElementNode> | ||
} | ||
} | ||
> {} | ||
export type VUIDLConditionalNode = Modify< | ||
@@ -120,4 +144,5 @@ UIDLConditionalNode, | ||
node: VUIDLNode | ||
reference: UIDLDynamicReference | ||
reference: UIDLDynamicReference | UIDLExpressionValue | ||
value?: string | number | boolean | ||
importDefinitions?: Record<string, UIDLExternalDependency> | ||
condition?: UIDLConditionalExpression | ||
@@ -133,3 +158,3 @@ } | ||
node: VUIDLElementNode | ||
dataSource?: UIDLAttributeValue | ||
dataSource?: UIDLRepeatNode['content']['dataSource'] | ||
meta?: UIDLRepeatMeta | ||
@@ -152,2 +177,3 @@ } | ||
| VCMSListRepeaterElementNode | ||
| VUIDLCMSMixedTypeNode | ||
| UIDLExpressionValue | ||
@@ -160,8 +186,14 @@ | UIDLInjectValue | ||
{ | ||
elementType: string | ||
semanticType?: string | ||
selfClosing?: boolean | ||
ignore?: boolean | ||
abilities?: { | ||
link?: VUIDLLinkNode | ||
} | ||
events: UIDLElement['events'] | ||
dependency?: UIDLDependency | ||
children?: VUIDLNode[] | ||
style?: Record<string, UIDLAttributeValue | string | number> | ||
attrs?: Record<string, UIDLAttributeValue | string | number> | ||
style?: Record<string, UIDLStyleValue | string | number> | ||
attrs?: Record<string, VUIDLAttributeValue | string | number> | ||
referencedStyles: Record< | ||
@@ -182,3 +214,3 @@ string, | ||
conditions: UIDLStyleConditions[] | ||
styles: Record<string, UIDLAttributeValue | string | number> | ||
styles: Record<string, UIDLStyleValue | string | number> | ||
} | ||
@@ -214,10 +246,9 @@ } | ||
node: VUIDLElementNode | ||
stateDefinitions: { | ||
route: Modify< | ||
UIDLRouteDefinitions, | ||
{ | ||
values: VUIDLStateValueDetails[] | ||
} | ||
> | ||
[x: string]: UIDLStateDefinition | ||
stateDefinitions?: { | ||
route: { | ||
type: string | ||
defaultValue: string | ||
values: VUIDLStateValueDetails[] | ||
} | ||
[x: string]: UIDLStateDefinition & { values?: VUIDLStateValueDetails[] } | ||
} | ||
@@ -263,3 +294,5 @@ designLanguage: { | ||
{ | ||
content: Record<string, string> | ||
content: { | ||
section: string | UIDLStaticValue | UIDLExpressionValue | ||
} | ||
} | ||
@@ -272,3 +305,3 @@ > | ||
content: { | ||
url: UIDLAttributeValue | string | ||
url: UIDLURLLinkNode['content']['url'] | string | ||
newTab: boolean | ||
@@ -283,3 +316,3 @@ } | ||
content: { | ||
routeName: string | UIDLAttributeValue | ||
routeName: string | UIDLNavLinkNode['content']['routeName'] | ||
} | ||
@@ -322,2 +355,3 @@ } | ||
| VUIDLFontAsset | ||
| UIDLLocalFontAsset | ||
@@ -358,1 +392,14 @@ export type VUIDLStyleInlineAsset = Modify< | ||
> | ||
export type VUIDLAttributeValue = ModifyUnionNumber< | ||
UIDLAttributeValue, | ||
UIDLElementNode, | ||
VUIDLElementNode | ||
> | ||
export type VUIDLPropDefinitions = Modify< | ||
UIDLPropDefinition, | ||
{ | ||
defaultValue?: string | number | boolean | unknown[] | object | (() => void) | VUIDLElementNode | ||
} | ||
> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
306895
5177