slightning-coco-widget
Version:
SLIGHTNING 的 CoCo 控件框架。
47 lines (46 loc) • 2.88 kB
TypeScript
import * as stringify from "@slightning/anything-to-string";
import * as CoCo from "../../coco";
import * as CreationProject1 from "../../creation-project-1";
import * as CreationProject2 from "../../creation-project-2";
import { MethodBlock, StandardMethodBlock } from "../types";
import { ChildTypeInfo, Type } from "./type";
export declare class FunctionType<A extends unknown[], R> implements Type<(...args: A) => R> {
readonly block: StandardMethodBlock;
readonly returns?: Type<R> | null | undefined;
readonly throws?: Type | null | undefined;
readonly defaultValue?: string | null | undefined;
readonly raw: boolean;
/**
* @param block 函数对应的积木,类似于控件方法类型定义中的 `block` 属性。
* @param returns 返回值类型。
* @param throws 抛出异常类型。
* @param raw 是否保持原始,若为时,则不会被装饰器转换。
*/
constructor({ block, returns, throws, defaultValue, raw }: {
block: MethodBlock;
returns?: Type<R> | null | undefined;
throws?: Type | null | undefined;
defaultValue?: string | null | undefined;
raw?: boolean | null | undefined;
});
validate(this: this, value: unknown): value is (...args: A) => R;
getSameDirectionChildren(this: this): ChildTypeInfo[];
getReverseDirectionChildren(this: this): ChildTypeInfo[];
isVoid(this: this): boolean;
typeToStringPrepare(this: this, config: stringify.RequiredConfig, context: stringify.PrepareContext): void;
typeToString(this: this, config: stringify.RequiredConfig, context: stringify.ToStringContext): string;
inlineTypeToStringPrepare(this: this, config: stringify.RequiredConfig, context: stringify.PrepareContext): void;
inlineTypeToString(this: this, config: stringify.RequiredConfig, context: stringify.ToStringContext): string;
toCoCoPropertyValueTypes(this: this): CoCo.PropertyValueTypes;
toCoCoMethodParamValueTypes(this: this): CoCo.MethodParamValueTypes;
toCoCoMethodValueTypes(this: this): CoCo.MethodValueTypes;
toCoCoEventParamValueTypes(this: this): CoCo.EventParamValueTypes;
toCreationProject1PropValueTypes(this: this): CreationProject1.PropValueTypes;
toCreationProject1MethodParamValueTypes(this: this): CreationProject1.MethodParamValueTypes;
toCreationProject1MethodValueTypes(this: this): CreationProject1.MethodValueTypes;
toCreationProject1EmitParamValueTypes(this: this): CreationProject1.EmitParamValueTypes;
toCreationProject2PropValueTypes(this: this): CreationProject2.PropValueTypes;
toCreationProject2MethodParamValueTypes(this: this): CreationProject2.MethodParamValueTypes;
toCreationProject2MethodValueTypes(this: this): CreationProject2.MethodValueTypes;
toCreationProject2EmitParamValueTypes(this: this): CreationProject2.EmitParamValueTypes;
}