@sigmacomputing/plugin 1.1.0 → 1.2.0
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.
- package/CHANGELOG.md +0 -14
- package/LICENSE +1 -1
- package/README.md +19 -24
- package/dist/cjs/index.cjs +506 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +438 -0
- package/dist/esm/index.d.ts +438 -0
- package/dist/esm/index.js +466 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/umd/sigmacomputing-plugin.umd.js +2 -0
- package/dist/umd/sigmacomputing-plugin.umd.js.map +1 -0
- package/package.json +69 -33
- package/src/client/initialize.ts +280 -0
- package/src/client.ts +3 -0
- package/src/globals.d.ts +2 -0
- package/{dist/index.d.ts → src/index.ts} +1 -1
- package/src/react/Context.ts +6 -0
- package/src/react/Provider.tsx +20 -0
- package/src/react/hooks.ts +298 -0
- package/src/react.ts +3 -0
- package/src/types.ts +412 -0
- package/src/utils/deepEqual.ts +23 -0
- package/src/utils/error.ts +10 -0
- package/src/utils/polyfillRequestAnimationFrame.ts +13 -0
- package/dist/client.d.ts +0 -2
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -5
- package/dist/error.d.ts +0 -3
- package/dist/error.d.ts.map +0 -1
- package/dist/error.js +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -22
- package/dist/react.d.ts +0 -3
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -20
- package/dist/types.d.ts +0 -332
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function isObject(obj: any) {
|
|
2
|
+
if (typeof obj === 'object' && obj != null) {
|
|
3
|
+
return true;
|
|
4
|
+
} else {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function deepEqual(obj1: any, obj2: any) {
|
|
10
|
+
if (obj1 === obj2) {
|
|
11
|
+
return true;
|
|
12
|
+
} else if (isObject(obj1) && isObject(obj2)) {
|
|
13
|
+
if (Object.keys(obj1).length !== Object.keys(obj2).length) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
for (const prop in obj1) {
|
|
17
|
+
if (!deepEqual(obj1[prop], obj2[prop])) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CustomPluginConfigOptions } from '../types';
|
|
2
|
+
|
|
3
|
+
export function validateConfigId(
|
|
4
|
+
configId: string,
|
|
5
|
+
expectedConfigType: CustomPluginConfigOptions['type'],
|
|
6
|
+
) {
|
|
7
|
+
if (configId === undefined) {
|
|
8
|
+
console.warn(`Invalid config ${expectedConfigType}: ${configId}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const FPS = 1000 / 60;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* requestAnimationFrame() calls are paused in most browsers when running in background tabs or hidden <iframe>s in order to improve performance and battery life
|
|
5
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
6
|
+
*/
|
|
7
|
+
export function polyfillRequestAnimationFrame(window: Window) {
|
|
8
|
+
if ('requestAnimationFrame' in window) {
|
|
9
|
+
window.requestAnimationFrame = callback => window.setTimeout(callback, FPS);
|
|
10
|
+
|
|
11
|
+
window.cancelAnimationFrame = id => window.clearTimeout(id);
|
|
12
|
+
}
|
|
13
|
+
}
|
package/dist/client.d.ts
DELETED
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,sCAAe,CAAC"}
|
package/dist/client.js
DELETED
package/dist/error.d.ts
DELETED
package/dist/error.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,yBAAyB,CAAC,MAAM,CAAC,QAKtD"}
|
package/dist/error.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateConfigId = void 0;
|
|
4
|
-
function validateConfigId(configId, expectedConfigType) {
|
|
5
|
-
if (configId === undefined) {
|
|
6
|
-
console.warn(`Invalid config ${expectedConfigType}: ${configId}`);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.validateConfigId = validateConfigId;
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.polyfillRequestAnimationFrame = void 0;
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./react"), exports);
|
|
20
|
-
__exportStar(require("./client"), exports);
|
|
21
|
-
var polyfillRequestAnimationFrame_1 = require("./utils/polyfillRequestAnimationFrame");
|
|
22
|
-
Object.defineProperty(exports, "polyfillRequestAnimationFrame", { enumerable: true, get: function () { return polyfillRequestAnimationFrame_1.polyfillRequestAnimationFrame; } });
|
package/dist/react.d.ts
DELETED
package/dist/react.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
|
package/dist/react.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SigmaClientProvider = void 0;
|
|
18
|
-
__exportStar(require("./react/hooks"), exports);
|
|
19
|
-
var Provider_1 = require("./react/Provider");
|
|
20
|
-
Object.defineProperty(exports, "SigmaClientProvider", { enumerable: true, get: function () { return Provider_1.SigmaClientProvider; } });
|
package/dist/types.d.ts
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
export declare type ScalarType = 'boolean' | 'datetime' | 'number' | 'integer' | 'text';
|
|
2
|
-
export declare type PrimitiveType = ScalarType | 'variant' | 'link';
|
|
3
|
-
export declare type ValueType = PrimitiveType | 'error';
|
|
4
|
-
/**
|
|
5
|
-
* All mutable workbook control variable types
|
|
6
|
-
*/
|
|
7
|
-
export declare type ControlType = 'boolean' | 'date' | 'number' | 'text' | 'text-list' | 'number-list' | 'date-list' | 'number-range' | 'date-range';
|
|
8
|
-
export interface PluginConfig<T> {
|
|
9
|
-
id: string;
|
|
10
|
-
config: T;
|
|
11
|
-
screenshot: boolean;
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Style colors available to plugins
|
|
16
|
-
* @typedef {object} PluginStyle
|
|
17
|
-
* @property {string} backgroundColor Background color set from workbook if any
|
|
18
|
-
*/
|
|
19
|
-
export interface PluginStyle {
|
|
20
|
-
backgroundColor: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @typedef {object} WorkbookVariable
|
|
24
|
-
* @property {string} name Name of control variable within workbook
|
|
25
|
-
* @property {{string}} defaultValue Current value containing at least type as string
|
|
26
|
-
*/
|
|
27
|
-
export interface WorkbookVariable {
|
|
28
|
-
name: string;
|
|
29
|
-
defaultValue: {
|
|
30
|
-
type: string;
|
|
31
|
-
value: any;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @typedef {object} UrlParameter
|
|
36
|
-
* @property {string} value Current url value
|
|
37
|
-
*/
|
|
38
|
-
export interface UrlParameter {
|
|
39
|
-
value: string;
|
|
40
|
-
}
|
|
41
|
-
export declare type WorkbookSelection = Record<string, {
|
|
42
|
-
type: string;
|
|
43
|
-
val?: unknown;
|
|
44
|
-
}>;
|
|
45
|
-
export declare type PluginMessageResponse = MessageEvent<{
|
|
46
|
-
type: string;
|
|
47
|
-
result: any[];
|
|
48
|
-
error: any;
|
|
49
|
-
}>;
|
|
50
|
-
export interface WbElement {
|
|
51
|
-
id: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @typedef {object} WorkbookElementData
|
|
55
|
-
* @property {Object<string, any>} data Workbook data sorted by column ID
|
|
56
|
-
*/
|
|
57
|
-
export interface WorkbookElementData {
|
|
58
|
-
[colId: string]: any[];
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Column data
|
|
62
|
-
* @typedef {object} WorkbookElementColumn
|
|
63
|
-
* @property {string} id Column ID
|
|
64
|
-
* @property {string} name Column Name
|
|
65
|
-
* @property {string} columnType Type of data contained within column
|
|
66
|
-
*/
|
|
67
|
-
export interface WorkbookElementColumn {
|
|
68
|
-
id: string;
|
|
69
|
-
name: string;
|
|
70
|
-
columnType: ValueType;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Record of Column data with corresponding IDs
|
|
74
|
-
* @typedef {object} WorkbookElementColumns
|
|
75
|
-
* @property {Object<string, WorkbookElementColumn>} column Column ID and corresponding column data
|
|
76
|
-
*/
|
|
77
|
-
export interface WorkbookElementColumns {
|
|
78
|
-
[colId: string]: WorkbookElementColumn;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Function to Unsubscribe from the corresponding elements
|
|
82
|
-
* @typedef {() => void} Unsubscriber
|
|
83
|
-
*/
|
|
84
|
-
export declare type Unsubscriber = () => void;
|
|
85
|
-
export interface CustomPluginConfigOptionBase {
|
|
86
|
-
name: string;
|
|
87
|
-
label?: string;
|
|
88
|
-
}
|
|
89
|
-
export interface CustomPluginConfigGroup extends CustomPluginConfigOptionBase {
|
|
90
|
-
type: 'group';
|
|
91
|
-
}
|
|
92
|
-
export interface CustomPluginConfigElement extends CustomPluginConfigOptionBase {
|
|
93
|
-
type: 'element';
|
|
94
|
-
}
|
|
95
|
-
export interface CustomPluginConfigColumn extends CustomPluginConfigOptionBase {
|
|
96
|
-
type: 'column';
|
|
97
|
-
allowedTypes?: ValueType[];
|
|
98
|
-
source: string;
|
|
99
|
-
allowMultiple: boolean;
|
|
100
|
-
}
|
|
101
|
-
export interface CustomPluginConfigText extends CustomPluginConfigOptionBase {
|
|
102
|
-
type: 'text';
|
|
103
|
-
source?: string;
|
|
104
|
-
secure?: boolean;
|
|
105
|
-
multiline?: boolean;
|
|
106
|
-
placeholder?: string;
|
|
107
|
-
defaultValue?: string;
|
|
108
|
-
}
|
|
109
|
-
export interface CustomPluginConfigToggle extends CustomPluginConfigOptionBase {
|
|
110
|
-
type: 'toggle';
|
|
111
|
-
source?: string;
|
|
112
|
-
defaultValue?: boolean;
|
|
113
|
-
}
|
|
114
|
-
export interface CustomPluginConfigCheckbox extends CustomPluginConfigOptionBase {
|
|
115
|
-
type: 'checkbox';
|
|
116
|
-
source?: string;
|
|
117
|
-
defaultValue?: boolean;
|
|
118
|
-
}
|
|
119
|
-
export interface CustomPluginConfigRadio extends CustomPluginConfigOptionBase {
|
|
120
|
-
type: 'radio';
|
|
121
|
-
source?: string;
|
|
122
|
-
singleLine?: boolean;
|
|
123
|
-
values: string[];
|
|
124
|
-
defaultValue?: string;
|
|
125
|
-
}
|
|
126
|
-
export interface CustomPluginConfigDropdown extends CustomPluginConfigOptionBase {
|
|
127
|
-
type: 'dropdown';
|
|
128
|
-
source?: string;
|
|
129
|
-
width?: string;
|
|
130
|
-
values: string[];
|
|
131
|
-
defaultValue?: string;
|
|
132
|
-
}
|
|
133
|
-
export interface CustomPluginConfigColor extends CustomPluginConfigOptionBase {
|
|
134
|
-
type: 'color';
|
|
135
|
-
source?: string;
|
|
136
|
-
}
|
|
137
|
-
export interface CustomPluginConfigVariable extends CustomPluginConfigOptionBase {
|
|
138
|
-
type: 'variable';
|
|
139
|
-
allowedTypes?: ControlType[];
|
|
140
|
-
}
|
|
141
|
-
export interface CustomPluginConfigInteraction extends CustomPluginConfigOptionBase {
|
|
142
|
-
type: 'interaction';
|
|
143
|
-
}
|
|
144
|
-
export interface CustomPluginConfigActionTrigger extends CustomPluginConfigOptionBase {
|
|
145
|
-
type: 'action-trigger';
|
|
146
|
-
}
|
|
147
|
-
export interface CustomPluginConfigActionEffect extends CustomPluginConfigOptionBase {
|
|
148
|
-
type: 'action-effect';
|
|
149
|
-
}
|
|
150
|
-
export interface CustomPluginConfigUrlParameter extends Omit<CustomPluginConfigOptionBase, 'label'> {
|
|
151
|
-
type: 'url-parameter';
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Different types Plugin Config Options
|
|
155
|
-
* @typedef {object} CustomPluginConfigOptions
|
|
156
|
-
* @property {string} type Type of config option
|
|
157
|
-
* @property {string} name Name ID of config option
|
|
158
|
-
* @property {(string | undefined)} label Displayed label for config option
|
|
159
|
-
*/
|
|
160
|
-
export declare type CustomPluginConfigOptions = CustomPluginConfigGroup | CustomPluginConfigElement | CustomPluginConfigColumn | CustomPluginConfigText | CustomPluginConfigToggle | CustomPluginConfigCheckbox | CustomPluginConfigRadio | CustomPluginConfigDropdown | CustomPluginConfigColor | CustomPluginConfigVariable | CustomPluginConfigInteraction | CustomPluginConfigActionTrigger | CustomPluginConfigActionEffect | CustomPluginConfigUrlParameter;
|
|
161
|
-
/**
|
|
162
|
-
* @typedef {object} PluginInstance
|
|
163
|
-
* @template T Type of Config passed in
|
|
164
|
-
* @property {string} sigmaEnv Permissions within Sigma Environment
|
|
165
|
-
* @property {object} config Set of helper functions for interacting with Plugin Config
|
|
166
|
-
* @property {object} elements Set of helper functions for interacting with Workbook Element Data
|
|
167
|
-
* @property {Function} destroy Destroys Plugin Instance and removes all subscriptions
|
|
168
|
-
*/
|
|
169
|
-
export interface PluginInstance<T = any> {
|
|
170
|
-
sigmaEnv: 'author' | 'viewer' | 'explorer';
|
|
171
|
-
config: {
|
|
172
|
-
/**
|
|
173
|
-
* Getter for entire Plugin Config
|
|
174
|
-
* @template T Config type to be passed in
|
|
175
|
-
* @returns {Partial<T>} Current Plugin Config
|
|
176
|
-
*/
|
|
177
|
-
get(): Partial<T> | undefined;
|
|
178
|
-
/**
|
|
179
|
-
* Performs a shallow merge between current config and passed in config
|
|
180
|
-
* @template T Config type to be passed in
|
|
181
|
-
* @param {Partial<T>} config Config to directly assign
|
|
182
|
-
*/
|
|
183
|
-
set(config: Partial<T>): void;
|
|
184
|
-
/**
|
|
185
|
-
* Getter for key within plugin config
|
|
186
|
-
* @template K Possible key within CustomPluginConfigOptions
|
|
187
|
-
* @param {K} key Key within config to retrieve
|
|
188
|
-
* @returns Value within config for passed in key
|
|
189
|
-
*/
|
|
190
|
-
getKey<K extends keyof T>(key: K): Pick<T, K>;
|
|
191
|
-
/**
|
|
192
|
-
* Assigns key value pair within plugin
|
|
193
|
-
* @template K Possible key within CustomPluginConfigOptions
|
|
194
|
-
* @template V Value corresponding to K
|
|
195
|
-
* @param {K} key Key within config to set
|
|
196
|
-
* @param {V} value New value to set key to
|
|
197
|
-
*/
|
|
198
|
-
setKey<K extends keyof T>(key: K, value: Pick<T, K>): void;
|
|
199
|
-
/**
|
|
200
|
-
* Subscriber for Plugin Config
|
|
201
|
-
* @param {Function} listener Function to be called upon changes to Plugin Config
|
|
202
|
-
*/
|
|
203
|
-
subscribe(listener: (arg0: T) => void): Unsubscriber;
|
|
204
|
-
/**
|
|
205
|
-
* Set possible options for plugin config
|
|
206
|
-
* @param {CustomPluginConfigOptions[]} options Possible config options
|
|
207
|
-
*/
|
|
208
|
-
configureEditorPanel(options: CustomPluginConfigOptions[]): void;
|
|
209
|
-
/**
|
|
210
|
-
* Gets a static image of a workbook variable
|
|
211
|
-
* @param {string} configId ID from config of type: 'variable'
|
|
212
|
-
* @returns {WorkbookVariable} Current value of the workbook variable
|
|
213
|
-
*/
|
|
214
|
-
getVariable(configId: string): WorkbookVariable;
|
|
215
|
-
/**
|
|
216
|
-
* Setter for workbook variable passed in
|
|
217
|
-
* @param {string} configId ID from config of type: 'variable'
|
|
218
|
-
* @param {unknown[]} values Values to assign to the workbook variable
|
|
219
|
-
*/
|
|
220
|
-
setVariable(configId: string, ...values: unknown[]): void;
|
|
221
|
-
/**
|
|
222
|
-
* @deprecated Use Action API instead
|
|
223
|
-
* Getter for interaction selection state
|
|
224
|
-
* @param {string} configId ID from config of type: 'interaction'
|
|
225
|
-
*/
|
|
226
|
-
getInteraction(configId: string): WorkbookSelection[];
|
|
227
|
-
/**
|
|
228
|
-
* @deprecated Use Action API instead
|
|
229
|
-
* Setter for interaction selection state
|
|
230
|
-
* @param {string} configId ID from config of type: 'interaction'
|
|
231
|
-
* @param {string} elementId Source element ID from element type in Plugin Config
|
|
232
|
-
* @param {Object} selection List of column IDs or Columns and values and key-value pairs to select
|
|
233
|
-
*/
|
|
234
|
-
setInteraction(configId: string, elementId: string, selection: WorkbookSelection[]): void;
|
|
235
|
-
/**
|
|
236
|
-
* Triggers an action based on the provided action trigger ID
|
|
237
|
-
* @param {string} configId ID from config of type: 'action-trigger'
|
|
238
|
-
*/
|
|
239
|
-
triggerAction(configId: string): void;
|
|
240
|
-
/**
|
|
241
|
-
* Registers an effect with the provided action effect ID
|
|
242
|
-
* @param {string} configId ID from config of type: 'action-effect'
|
|
243
|
-
* @param {Function} effect The effect function to register
|
|
244
|
-
* @returns {Unsubscriber} A callable unsubscriber
|
|
245
|
-
*/
|
|
246
|
-
registerEffect(configId: string, effect: () => void): () => void;
|
|
247
|
-
/**
|
|
248
|
-
* Overrider function for Config Ready state
|
|
249
|
-
* @param {boolean} loadingState Boolean representing if Plugin Config is still loading
|
|
250
|
-
*/
|
|
251
|
-
setLoadingState(ready: boolean): void;
|
|
252
|
-
/**
|
|
253
|
-
* Allows users to subscribe to changes in the passed in variable
|
|
254
|
-
* @param {string} configId ID from config of type: 'variable'
|
|
255
|
-
* @callback callback Function to be called upon receiving an updated workbook variable
|
|
256
|
-
* @returns {Unsubscriber} A callable unsubscriber
|
|
257
|
-
*/
|
|
258
|
-
subscribeToWorkbookVariable(configId: string, callback: (input: WorkbookVariable) => void): Unsubscriber;
|
|
259
|
-
/**
|
|
260
|
-
* Allows users to subscribe to changes in the url parameter
|
|
261
|
-
* @param {string} configId ID from config of type: 'url-parameter'
|
|
262
|
-
* @callback callback Function to be called upon receiving an updated url parameter
|
|
263
|
-
* @returns {Unsubscriber} A callable unsubscriber
|
|
264
|
-
*/
|
|
265
|
-
subscribeToUrlParameter(configId: string, callback: (input: UrlParameter) => void): Unsubscriber;
|
|
266
|
-
/**
|
|
267
|
-
* Gets the current value of a url parameter
|
|
268
|
-
* @param {string} configId ID from config of type: 'url-parameter'
|
|
269
|
-
* @returns {UrlParameter} Current value of the url parameter
|
|
270
|
-
*/
|
|
271
|
-
getUrlParameter(configId: string): UrlParameter;
|
|
272
|
-
/**
|
|
273
|
-
* Setter for url parameter
|
|
274
|
-
* @param {string} configId ID from config of type: 'url-parameter'
|
|
275
|
-
* @param {string} value Value to assign to the url parameter
|
|
276
|
-
*/
|
|
277
|
-
setUrlParameter(configId: string, value: string): void;
|
|
278
|
-
/**
|
|
279
|
-
* @deprecated Use Action API instead
|
|
280
|
-
* Allows users to subscribe to changes in the passed in interaction ID
|
|
281
|
-
* @param {string} configId ID from the config of type: 'interaction'
|
|
282
|
-
* @callback callback Function to be called upon receiving an updated interaction selection state
|
|
283
|
-
* @returns {Unsubscriber} A callable unsubscriber
|
|
284
|
-
*/
|
|
285
|
-
subscribeToWorkbookInteraction(configId: string, callback: (input: WorkbookSelection[]) => void): Unsubscriber;
|
|
286
|
-
};
|
|
287
|
-
elements: {
|
|
288
|
-
/**
|
|
289
|
-
* Getter for Column Data by parent sheet ID
|
|
290
|
-
* @param {string} configId ID from config of type: 'element'
|
|
291
|
-
* @returns {WorkbookElementColumns} Column values contained within corresponding sheet
|
|
292
|
-
*/
|
|
293
|
-
getElementColumns(configId: string): Promise<WorkbookElementColumns>;
|
|
294
|
-
/**
|
|
295
|
-
* Subscriber to changes in column data by ID
|
|
296
|
-
* @param {string} configId ID from config of type: 'element'
|
|
297
|
-
* @callback callback Callback function to be called upon changes to column data
|
|
298
|
-
* @returns {Unsubscriber} Callable unsubscriber to column data changes
|
|
299
|
-
*/
|
|
300
|
-
subscribeToElementColumns(configId: string, callback: (cols: WorkbookElementColumns) => void): Unsubscriber;
|
|
301
|
-
/**
|
|
302
|
-
* Subscriber for the data within a given sheet
|
|
303
|
-
* @param {string} configId ID from config of type: 'element'
|
|
304
|
-
* @callback callback Function to call on data passed in
|
|
305
|
-
* @returns {Unsubscriber} A callable unsubscriber to changes in the data
|
|
306
|
-
*/
|
|
307
|
-
subscribeToElementData(configId: string, callback: (data: WorkbookElementData) => void): Unsubscriber;
|
|
308
|
-
/**
|
|
309
|
-
* Ask sigma to load more data
|
|
310
|
-
* @param {string} configId ID from config of type: 'element'
|
|
311
|
-
*/
|
|
312
|
-
fetchMoreElementData(configId: string): void;
|
|
313
|
-
};
|
|
314
|
-
style: {
|
|
315
|
-
/**
|
|
316
|
-
* Subscribe to style updates
|
|
317
|
-
* @param callback Function to call when style updates
|
|
318
|
-
* @returns Unsubscriber function
|
|
319
|
-
*/
|
|
320
|
-
subscribe(callback: (style: PluginStyle) => void): () => void;
|
|
321
|
-
/**
|
|
322
|
-
* Request current style from workbook
|
|
323
|
-
* @returns Promise with current style
|
|
324
|
-
*/
|
|
325
|
-
get(): Promise<PluginStyle>;
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* Destroys plugin instance and removes all subscribers
|
|
329
|
-
*/
|
|
330
|
-
destroy(): void;
|
|
331
|
-
}
|
|
332
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAChF,oBAAY,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAC5D,oBAAY,SAAS,GAAG,aAAa,GAAG,OAAO,CAAC;AAEhD;;GAEG;AACH,oBAAY,WAAW,GACnB,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,WAAW,GACX,aAAa,GACb,WAAW,GACX,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEhF,oBAAY,qBAAqB,GAAG,YAAY,CAAC;IAC/C,IAAI,EAAE,MAAM,CA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