MCPcopy Create free account
hub / github.com/apitable/apitable / syncCmd

Method syncCmd

packages/widget-sdk/src/message/widget_message.ts:122–133  ·  view source on GitHub ↗

* Send cmd to main application. * @param cmdOptions

(cmdOptions: ICollaCommandOptions)

Source from the content-addressed store, hash-verified

120 * @param cmdOptions
121 */
122 syncCmd(cmdOptions: ICollaCommandOptions): Promise<ICollaCommandExecuteResult<any>> {
123 this.emit(MessageType.WIDGET_SYNC_COMMAND, { success: true, data: cmdOptions });
124 return new Promise((resolve, reject) => {
125 this.on(MessageType.MAIN_SYNC_COMMAND_RESULT, (res: IResponse<ICollaCommandExecuteResult<any>>) => {
126 if (res.success && res.data) {
127 resolve(res.data);
128 return;
129 }
130 reject(res.message);
131 });
132 });
133 }
134
135 /**
136 * Trigger expandRecord.

Callers

nothing calls this directly

Calls 2

emitMethod · 0.95
onMethod · 0.95

Tested by

no test coverage detected