UNPKG

1.18 kBTypeScriptView Raw
1import type { ArrayFlag, NumberFlag, StringFlag, BooleanFlag } from '../types.js';
2/**
3 * Namespace for defining flags using decorators.
4 */
5export declare const flags: {
6 /**
7 * Define option that accepts a string value
8 */
9 string<Type = string>(options?: Partial<Omit<StringFlag<Type>, "type">>): <Key extends string, Target extends { [K in Key]?: Type; }>(target: Target, propertyName: Key) => void;
10 /**
11 * Define option that accepts a boolean value
12 */
13 boolean<Type = boolean>(options?: Partial<Omit<BooleanFlag<Type>, "type">>): <Key extends string, Target extends { [K in Key]?: Type; }>(target: Target, propertyName: Key) => void;
14 /**
15 * Define option that accepts a number value
16 */
17 number<Type = number>(options?: Partial<Omit<NumberFlag<Type>, "type">>): <Key extends string, Target extends { [K in Key]?: Type; }>(target: Target, propertyName: Key) => void;
18 /**
19 * Define option that accepts an array of values
20 */
21 array<Type extends any[] = string[]>(options?: Partial<Omit<ArrayFlag<Type>, "type">>): <Key extends string, Target extends { [K in Key]?: Type; }>(target: Target, propertyName: Key) => void;
22};