1/** 2 * You can add another Tuple signature if needed. 3 * This type aggregates all known tuple-like types that are available across all APIs. 4 */ 5export type Tuple = [number, number]; 6 7export type Platform = 'android' | 'ios' | 'web'; 8 9export type Parameter = { 10 name: string; 11 platforms?: Platform[]; 12}; 13 14export type BooleanParameter = Parameter & { 15 type: 'boolean'; 16 initial: boolean; 17}; 18 19export type StringParameter = Parameter & { 20 type: 'string'; 21 values: (undefined | string)[]; 22}; 23 24export type NumberParameter = Parameter & { 25 type: 'number'; 26 values: (undefined | number)[]; 27}; 28 29export type EnumParameter = Parameter & { 30 type: 'enum'; 31 values: { 32 name: string; 33 value: any; 34 }[]; 35}; 36 37export type PrimitiveParameter = 38 | BooleanParameter 39 | StringParameter 40 | NumberParameter 41 | EnumParameter; 42 43export type ObjectParameter = Parameter & { 44 type: 'object'; 45 properties: PrimitiveParameter[]; 46}; 47 48export type ConstantParameter = Parameter & { 49 type: 'constant'; 50 value: any; 51}; 52 53export type FunctionParameter = PrimitiveParameter | ObjectParameter | ConstantParameter; 54 55export type PrimitiveArgument = boolean | number | string | Tuple | undefined; 56 57export type FunctionArgument = PrimitiveArgument | Record<string, PrimitiveArgument>; 58 59/** 60 * Generic and intentionally not very well typed function signature to describe any action that can be called from the FunctionDemo. 61 */ 62export type ActionFunction = (...args: any[]) => Promise<unknown> | unknown; 63 64export type ArgumentName = string | [objectName: string, propertyName: string]; 65 66export type OnArgumentChangeCallback = (name: ArgumentName, value: PrimitiveArgument) => void; 67