Files
wehub-resource-sync 2114b14ee0
Sync main into demo / sync (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:35:26 +08:00

67 lines
1.7 KiB
TypeScript

export type Primitive = string | number | boolean | null;
export interface NavigationDeclaration {
app: string;
routes: RouteDeclaration[];
transitions: TransitionDeclaration[];
capabilities: {
historyBack: boolean;
};
}
export interface RouteDeclaration {
path: string;
component: string;
params: Record<string, 'string' | 'number'>;
entryPoint: EntryPointDeclaration;
scrollContainers?: ScrollContainerDeclaration[];
uiStates: Array<{
id: string;
search: Record<string, string | null>;
description: string;
actions?: ActionDeclaration[];
}>;
queryParams: Record<string, 'string' | 'number'>;
description: string;
}
export type EntryPointDeclaration = 'none' | 'home' | 'deepLink' | 'both';
export interface ScrollContainerDeclaration {
name: string;
direction: 'vertical' | 'horizontal';
description: string;
}
export type GestureType = 'tap' | 'longPress' | 'doubleTap' | 'back';
export interface TransitionDeclaration {
id: string;
from: '*' | string | FromConstraint | Array<'*' | string | FromConstraint>;
to: string;
search: Record<string, string | null>;
searchParams: Record<string, 'string' | 'number'>;
preserveParams?: string[];
mode: 'push' | 'replace';
params: Record<string, 'string' | 'number'>;
label: string;
ui: {
placement: 'topbar' | 'tabbar' | 'content' | 'fab' | 'none';
icon: string;
gesture: GestureType;
};
}
export interface FromConstraint {
path: string;
search?: Record<string, string | '*' | null>;
}
export interface ActionDeclaration {
id: string;
label: string;
behavior: 'toggle' | 'select' | 'submit' | 'input' | 'other';
scope?: 'item';
paramsSchema?: Record<string, 'string' | 'number' | 'boolean'>;
}