diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d194970..3d10a09 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@kissflow/lowcode-client-sdk", - "version": "1.0.26", + "version": "1.0.27", "description": "JavaScript SDK for developing over the Kissflow lowcode platform", "types": "dist/index.d.ts", "files": [ diff --git a/packages/sdk/src/form/index.ts b/packages/sdk/src/form/index.ts index 7093ac5..86d6324 100644 --- a/packages/sdk/src/form/index.ts +++ b/packages/sdk/src/form/index.ts @@ -72,7 +72,7 @@ class Table extends BaseSDK { }); } - addRows(rows: [object]) { + addRows(rows: object[]) { return this._postMessageAsync(LISTENER_CMDS.ADD_TABLE_ROWS, { tableId: this.tableId, rows @@ -86,7 +86,7 @@ class Table extends BaseSDK { }); } - deleteRows(rows: [string]){ + deleteRows(rows: string[]){ return this._postMessageAsync(LISTENER_CMDS.DELETE_TABLE_ROW, { tableId: this.tableId, rows diff --git a/packages/sdk/src/lowcode.ts b/packages/sdk/src/lowcode.ts index c2de0f7..eb53ee5 100644 --- a/packages/sdk/src/lowcode.ts +++ b/packages/sdk/src/lowcode.ts @@ -6,7 +6,7 @@ import { Application, Page, Component, Popup } from "./app"; import { window } from "./window"; import { SDKContext } from "./types/internal"; -import { userObject, accountObject, environmentObject } from "./types/external"; +import { userObject, accountObject, environmentObject, FetchOptions } from "./types/external"; class LowcodeSDK extends BaseSDK { context: Component | Form | TableForm | Page | Popup; @@ -48,9 +48,7 @@ class LowcodeSDK extends BaseSDK { } async api( url: string, - args?: { - headers: object; - } + args?: FetchOptions ) { const response = await globalThis.fetch(url, { ...args, diff --git a/packages/sdk/src/nocode.ts b/packages/sdk/src/nocode.ts index 1820bcf..305dab8 100644 --- a/packages/sdk/src/nocode.ts +++ b/packages/sdk/src/nocode.ts @@ -5,7 +5,7 @@ import { Client, Formatter } from "./utils"; import { window } from "./window"; import { SDKContext } from "./types/internal"; -import { userObject, accountObject } from "./types/external"; +import { userObject, accountObject, FetchOptions } from "./types/external"; class NocodeSDK extends BaseSDK { context: Form | TableForm; @@ -35,9 +35,7 @@ class NocodeSDK extends BaseSDK { } async api( url: string, - args?: { - headers: object; - } + args?: FetchOptions ) { const response = await globalThis.fetch(url, { ...args, diff --git a/packages/sdk/src/types/external.ts b/packages/sdk/src/types/external.ts index 03d6430..ebbcf68 100644 --- a/packages/sdk/src/types/external.ts +++ b/packages/sdk/src/types/external.ts @@ -24,4 +24,10 @@ export type DataformItem = { export type ProcessItem = { _id: string; _activity_instance_id: string; +} + +export type FetchOptions = { + method?: string, + body?: string | object; + headers?: object; } \ No newline at end of file