@nasl/types
Version:
NASL types for TypeScript Declaration
45 lines (34 loc) • 1.59 kB
TypeScript
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/adjacent-overload-signatures */
declare namespace nasl.ui {
export class ViewComponent {
// name: '__ViewComponent';
}
export class ViewComponentOptions {
// name: '__ViewComponentOptions';
({
title: '显示条件',
description: '是否展示组件',
setter: {
concept: 'SwitchSetter',
},
})
_if: nasl.core.Boolean;
({
title: '工具提示',
description: '在鼠标悬停时显示的文字',
})
_tooltip: nasl.core.String;
}
export function Component(options?: ViewComponentOpts): (target: any) => void;
export function Prop(options?: PropOpts<any, any>): (target: any, key: string) => void;
export function Prop<T extends object, K extends keyof T>(options?: PropOpts<T, K>): (target: T, key: K) => void;
export function Event(options?: EventOpts): (target: any, key: string) => void;
export function Slot(options?: SlotOpts): (target: any, key: string) => void;
/**
* 与类型推导有关,必须将返回值类型放在第一个参数位置
*/
export type SlotType<T extends (...args: Array<any>) => Array<any>> = (ret: ReturnType<T>, ...args: Parameters<T>) => ReturnType<T>;
export function Method(options?: LogicOpts): (target: any, key: string) => void;
export function Param(options?: ParamOpts): (target: any, key: string, paramIndex: number) => void;
}