@fnlb-project/shared 1.5.121 → 1.5.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,15 +38,28 @@ export interface IArrayInput extends IBaseActionInput {
38
38
  type: ActionIOType.Array;
39
39
  }
40
40
  export type ActionInput = ISingleInput | ISelectInput | IArrayInput;
41
- export declare class ActionUsageClient {
41
+ export type DataTypeToType<T extends ActionDataType> = T extends ActionDataType.Integer | ActionDataType.Float ? number : T extends ActionDataType.Boolean ? boolean : string;
42
+ export declare class ActionUsageClient<Schema extends Record<string, any> = {}> {
42
43
  params: ActionInput[];
43
44
  constructor(params?: ActionInput[]);
44
- addParam(id: string, name: string, description: string, extended?: boolean, examples?: string[], dataType?: ActionDataType): this;
45
- addOptionalParam(id: string, name: string, description: string, extended?: boolean, examples?: string[], dataType?: ActionDataType): this;
46
- addSelect(id: string, name: string, description: string, options: ISelectInputOptions[], examples?: string[], dataType?: ActionDataType): this;
47
- addOptionalSelect(id: string, name: string, description: string, options: ISelectInputOptions[], examples?: string[], dataType?: ActionDataType): this;
48
- addArrayParam(id: string, name: string, description: string, examples?: string[], dataType?: ActionDataType): this;
49
- addOptionalArrayParam(id: string, name: string, description: string, examples?: string[], dataType?: ActionDataType): this;
45
+ addParam<Id extends string, DT extends ActionDataType = ActionDataType.String>(id: Id, name: string, description: string, extended?: boolean, examples?: string[], dataType?: DT): ActionUsageClient<Schema & {
46
+ [K in Id]: DataTypeToType<DT>;
47
+ }>;
48
+ addOptionalParam<Id extends string, DT extends ActionDataType = ActionDataType.String>(id: Id, name: string, description: string, extended?: boolean, examples?: string[], dataType?: DT): ActionUsageClient<Schema & {
49
+ [K in Id]: DataTypeToType<DT>;
50
+ }>;
51
+ addSelect<Id extends string, DT extends ActionDataType = ActionDataType.String>(id: Id, name: string, description: string, options: ISelectInputOptions[], examples?: string[], dataType?: DT): ActionUsageClient<Schema & {
52
+ [K in Id]: DataTypeToType<DT>;
53
+ }>;
54
+ addOptionalSelect<Id extends string, DT extends ActionDataType = ActionDataType.String>(id: Id, name: string, description: string, options: ISelectInputOptions[], examples?: string[], dataType?: DT): ActionUsageClient<Schema & {
55
+ [K in Id]: DataTypeToType<DT>;
56
+ }>;
57
+ addArrayParam<Id extends string, DT extends ActionDataType = ActionDataType.String>(id: Id, name: string, description: string, examples?: string[], dataType?: DT): ActionUsageClient<Schema & {
58
+ [K in Id]: DataTypeToType<DT>[];
59
+ }>;
60
+ addOptionalArrayParam<Id extends string, DT extends ActionDataType = ActionDataType.String>(id: Id, name: string, description: string, examples?: string[], dataType?: DT): ActionUsageClient<Schema & {
61
+ [K in Id]: DataTypeToType<DT>[];
62
+ }>;
50
63
  getUsage(): string;
51
64
  getExample(): string;
52
65
  static getParamUsage(param: ActionInput): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fnlb-project/shared",
3
- "version": "1.5.121",
3
+ "version": "1.5.122",
4
4
  "description": "FNLB Shared Library",
5
5
  "files": [
6
6
  "dist"