@i2analyze/notebook-sdk 1.3.0 → 1.4.0-dev.1
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/lib/gen/notebook-sdk-public.d.ts +238 -0
- package/lib/index.js +24 -0
- package/package.json +1 -1
|
@@ -119,6 +119,11 @@ export declare namespace app {
|
|
|
119
119
|
* @i2since 1.1
|
|
120
120
|
*/
|
|
121
121
|
runUntrackedMutations(mutationHandler: UntrackedMutationHandler, options?: ITransactionOptions): void;
|
|
122
|
+
/**
|
|
123
|
+
* Gets the command identifiers of the default system dialog actions.
|
|
124
|
+
* @i2since 1.4
|
|
125
|
+
*/
|
|
126
|
+
readonly systemActions: dialog.ISystemDialogActions;
|
|
122
127
|
}
|
|
123
128
|
/**
|
|
124
129
|
* A report on the result of one or more mutations.
|
|
@@ -2125,6 +2130,14 @@ export declare namespace commands {
|
|
|
2125
2130
|
* @i2since 1.0
|
|
2126
2131
|
*/
|
|
2127
2132
|
readonly applicationRibbon: IApplicationRibbon;
|
|
2133
|
+
/**
|
|
2134
|
+
* Gets the area that represents the chart's surface pop-up menu.
|
|
2135
|
+
*
|
|
2136
|
+
* @remarks
|
|
2137
|
+
* The `chartPopupMenu` area supports only top-level groups, which correspond to sets of related actions that are separated by dividers in the menu.
|
|
2138
|
+
* @i2since 1.4
|
|
2139
|
+
*/
|
|
2140
|
+
readonly chartSurfacePopupMenu: IActionArea<IChartSurfacePopupMenuSystemGroups, IMenuGroup>;
|
|
2128
2141
|
/**
|
|
2129
2142
|
* Gets the area that represents the chart's pop-up menu.
|
|
2130
2143
|
*
|
|
@@ -2328,6 +2341,17 @@ export declare namespace commands {
|
|
|
2328
2341
|
*/
|
|
2329
2342
|
readonly discover: GroupId;
|
|
2330
2343
|
}
|
|
2344
|
+
/**
|
|
2345
|
+
* A lookup table for the identifiers of the system action groups in the chart surface popup menu.
|
|
2346
|
+
* @i2since 1.4
|
|
2347
|
+
*/
|
|
2348
|
+
export interface IChartSurfacePopupMenuSystemGroups {
|
|
2349
|
+
/**
|
|
2350
|
+
* Gets the identifier of the system action group related to selection.
|
|
2351
|
+
* @i2since 1.4
|
|
2352
|
+
*/
|
|
2353
|
+
readonly select: GroupId;
|
|
2354
|
+
}
|
|
2331
2355
|
}
|
|
2332
2356
|
|
|
2333
2357
|
/**
|
|
@@ -2969,6 +2993,200 @@ export declare namespace data {
|
|
|
2969
2993
|
}
|
|
2970
2994
|
}
|
|
2971
2995
|
|
|
2996
|
+
/**
|
|
2997
|
+
* The members of the `dialog` namespace enable you to open the dialog over the application that you write for your plug-ins with the i2 Notebook application.
|
|
2998
|
+
*
|
|
2999
|
+
* @public
|
|
3000
|
+
* @i2since 1.4
|
|
3001
|
+
*/
|
|
3002
|
+
export declare namespace dialog {
|
|
3003
|
+
/**
|
|
3004
|
+
* The size of the dialog.
|
|
3005
|
+
* @i2since 1.4
|
|
3006
|
+
*/
|
|
3007
|
+
export type DialogSize = 'small' | 'medium' | 'large';
|
|
3008
|
+
/**
|
|
3009
|
+
* An identifier of dialog action.
|
|
3010
|
+
* @i2since 1.4
|
|
3011
|
+
*/
|
|
3012
|
+
export type DialogActionId = string;
|
|
3013
|
+
/**
|
|
3014
|
+
* A set of information to create dialog action button.
|
|
3015
|
+
* @i2since 1.4
|
|
3016
|
+
*/
|
|
3017
|
+
export interface IDialogAction {
|
|
3018
|
+
/**
|
|
3019
|
+
* Indicates the visibility state of the action button.
|
|
3020
|
+
* @i2since 1.4
|
|
3021
|
+
*/
|
|
3022
|
+
enabled?: boolean;
|
|
3023
|
+
/**
|
|
3024
|
+
* Gets the value to show in the action button.
|
|
3025
|
+
* @i2since 1.4
|
|
3026
|
+
*/
|
|
3027
|
+
label?: string;
|
|
3028
|
+
}
|
|
3029
|
+
/**
|
|
3030
|
+
* A Basic set of information to create dialog action button.
|
|
3031
|
+
* @i2since 1.4
|
|
3032
|
+
*/
|
|
3033
|
+
export interface IDialogActionConfig extends IDialogAction {
|
|
3034
|
+
/**
|
|
3035
|
+
* Gets the identifier of the dialog action.
|
|
3036
|
+
* @i2since 1.4
|
|
3037
|
+
*/
|
|
3038
|
+
readonly id: DialogActionId;
|
|
3039
|
+
}
|
|
3040
|
+
/**
|
|
3041
|
+
* A set of information for creating a dialog.
|
|
3042
|
+
*
|
|
3043
|
+
* @typeParam TInitialize - The type of data to populate the dialog content.
|
|
3044
|
+
* @i2since 1.4
|
|
3045
|
+
*/
|
|
3046
|
+
export interface IDialogConfig<TInitialize> {
|
|
3047
|
+
/**
|
|
3048
|
+
* Gets the title of the dialog, which appears as a heading in the user interface.
|
|
3049
|
+
* @i2since 1.4
|
|
3050
|
+
*/
|
|
3051
|
+
readonly name: string;
|
|
3052
|
+
/**
|
|
3053
|
+
* Gets the path to the content to host the dialog content, relative to the plug-in entry point.
|
|
3054
|
+
*
|
|
3055
|
+
* @remarks
|
|
3056
|
+
* For example, if `path` is '`./`', then the server uses the folder that contains the entry point.
|
|
3057
|
+
* @i2since 1.4
|
|
3058
|
+
*/
|
|
3059
|
+
readonly path: string;
|
|
3060
|
+
/**
|
|
3061
|
+
* Gets the size of the dialog.
|
|
3062
|
+
* @i2since 1.4
|
|
3063
|
+
*/
|
|
3064
|
+
readonly size: DialogSize;
|
|
3065
|
+
/**
|
|
3066
|
+
* Gets the information that required to create the dialog content.
|
|
3067
|
+
*
|
|
3068
|
+
* @typeParam TInitialize - The type of data to populate the dialog content.
|
|
3069
|
+
* @i2since 1.4
|
|
3070
|
+
*/
|
|
3071
|
+
readonly initialValue?: TInitialize;
|
|
3072
|
+
/**
|
|
3073
|
+
* Gets the information to show the button like OK, Cancel.
|
|
3074
|
+
*
|
|
3075
|
+
* @i2since 1.4
|
|
3076
|
+
*/
|
|
3077
|
+
readonly actions: (IDialogActionConfig | DialogActionId)[];
|
|
3078
|
+
}
|
|
3079
|
+
/**
|
|
3080
|
+
* A collection of methods and properties that allow plug-in dialog to interact with i2 Notebook.
|
|
3081
|
+
*
|
|
3082
|
+
* @i2since 1.4
|
|
3083
|
+
*/
|
|
3084
|
+
export interface IDialogApi extends app.IApplication {
|
|
3085
|
+
/**
|
|
3086
|
+
* Updates the dialog action buttons it could be label or visibility.
|
|
3087
|
+
*
|
|
3088
|
+
* @param id - An id of action which needs to be updated.
|
|
3089
|
+
* @param action - An updated action.
|
|
3090
|
+
* @i2since 1.4
|
|
3091
|
+
*/
|
|
3092
|
+
updateAction(id: DialogActionId, action: IDialogAction): void;
|
|
3093
|
+
/**
|
|
3094
|
+
* Submits the committed value and close the dialog.
|
|
3095
|
+
*
|
|
3096
|
+
* @param value - A value that is committed/expected when the dialog is closed.
|
|
3097
|
+
* @typeParam TResult - The type of data when the dialog is submitted.
|
|
3098
|
+
* @i2since 1.4
|
|
3099
|
+
*/
|
|
3100
|
+
submitAndClose<TResult>(value: TResult): void;
|
|
3101
|
+
/**
|
|
3102
|
+
* Closes the dialog.
|
|
3103
|
+
*
|
|
3104
|
+
* @i2since 1.4
|
|
3105
|
+
*/
|
|
3106
|
+
close(): void;
|
|
3107
|
+
/**
|
|
3108
|
+
* Gets the information that required to create the dialog content.
|
|
3109
|
+
*
|
|
3110
|
+
* @typeParam TInitialize - The type of data to populate the dialog content.
|
|
3111
|
+
* @returns A value to populate the dialog content.
|
|
3112
|
+
* @i2since 1.4
|
|
3113
|
+
*/
|
|
3114
|
+
getInitiaValue<TInitialize>(): TInitialize;
|
|
3115
|
+
/**
|
|
3116
|
+
* Adds a listener for events that might affect the dialog.
|
|
3117
|
+
*
|
|
3118
|
+
* @param type - The type of event to subscribe to.
|
|
3119
|
+
* @param listener - A function to handle the event.
|
|
3120
|
+
* @typeParam K - The type of event to subscribe to.
|
|
3121
|
+
* @returns A function that can be called to remove the listener.
|
|
3122
|
+
* @i2since 1.4
|
|
3123
|
+
*/
|
|
3124
|
+
addEventListener<K extends keyof DialogEventMap>(type: K, listener: DialogEventMap[K]): () => void;
|
|
3125
|
+
/**
|
|
3126
|
+
* Removes a listener for events that might affect the dialog.
|
|
3127
|
+
*
|
|
3128
|
+
* @param type - The type of event to unsubscribe from.
|
|
3129
|
+
* @param listener - A function that was previously added as a listener.
|
|
3130
|
+
* @typeParam K - The type of event to unsubscribe from.
|
|
3131
|
+
* @i2since 1.4
|
|
3132
|
+
*/
|
|
3133
|
+
removeEventListener<K extends keyof DialogEventMap>(type: K, listener: DialogEventMap[K]): void;
|
|
3134
|
+
}
|
|
3135
|
+
/**
|
|
3136
|
+
* A mapping of dialog event types to their listener types.
|
|
3137
|
+
* @i2since 1.0
|
|
3138
|
+
*/
|
|
3139
|
+
export interface DialogEventMap extends app.ApplicationEventMap {
|
|
3140
|
+
/**
|
|
3141
|
+
* Gets the type of the callback method that listens for "action" events.
|
|
3142
|
+
* @i2since 1.4
|
|
3143
|
+
*/
|
|
3144
|
+
readonly action: DialogActionListener;
|
|
3145
|
+
}
|
|
3146
|
+
/**
|
|
3147
|
+
* A callback function that handles dialog action button events.
|
|
3148
|
+
*
|
|
3149
|
+
* @remarks
|
|
3150
|
+
* Typically, this listener receieves an event after action button is clicked.
|
|
3151
|
+
*
|
|
3152
|
+
* @param actionId - An identifier of the action button which is clicked
|
|
3153
|
+
* @i2since 1.4
|
|
3154
|
+
*/
|
|
3155
|
+
export type DialogActionListener = (actionId: DialogActionId) => void;
|
|
3156
|
+
/**
|
|
3157
|
+
* A lookup table for the dialog action identifiers of the default actions.
|
|
3158
|
+
* @i2since 1.4
|
|
3159
|
+
*/
|
|
3160
|
+
export interface ISystemDialogActions {
|
|
3161
|
+
/**
|
|
3162
|
+
* Gets the identifier of the "submit" action.
|
|
3163
|
+
* @i2since 1.4
|
|
3164
|
+
*/
|
|
3165
|
+
submit: DialogActionId;
|
|
3166
|
+
/**
|
|
3167
|
+
* Gets the identifier of the "cancel" action.
|
|
3168
|
+
* @i2since 1.4
|
|
3169
|
+
*/
|
|
3170
|
+
cancel: DialogActionId;
|
|
3171
|
+
/**
|
|
3172
|
+
* Gets the identifier of the "close" action.
|
|
3173
|
+
* @i2since 1.4
|
|
3174
|
+
*/
|
|
3175
|
+
close: DialogActionId;
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
/**
|
|
3180
|
+
* Retrieves the plug-in dialog API.
|
|
3181
|
+
*
|
|
3182
|
+
* @returns A promise that resolves to the dialog API.
|
|
3183
|
+
* @throws `Error` (through the promise) if the version of the SDK was incompatible with the deployed version of i2 Notebook.
|
|
3184
|
+
*
|
|
3185
|
+
* @public
|
|
3186
|
+
* @i2since 1.4
|
|
3187
|
+
*/
|
|
3188
|
+
export declare function getDialogApi(): Promise<dialog.IDialogApi>;
|
|
3189
|
+
|
|
2972
3190
|
/**
|
|
2973
3191
|
* Retrieves the plug-in entry point API.
|
|
2974
3192
|
*
|
|
@@ -3036,6 +3254,16 @@ export declare interface IEntryPointApi extends app.IApplication {
|
|
|
3036
3254
|
* @i2since 1.3
|
|
3037
3255
|
*/
|
|
3038
3256
|
createToolView(config: toolview.IToolViewConfig): toolview.IToolView;
|
|
3257
|
+
/**
|
|
3258
|
+
* Opens a dialog with specified configuration.
|
|
3259
|
+
*
|
|
3260
|
+
* @param config - The information to create a modal dialog.
|
|
3261
|
+
* @typeParam TResult - The type of data when the dialog is submitted.
|
|
3262
|
+
* @typeParam TInitialize - The type of data to populate the dialog content.
|
|
3263
|
+
* @returns The value submitted from the dialog.
|
|
3264
|
+
* @i2since 1.4
|
|
3265
|
+
*/
|
|
3266
|
+
showDialog<TResult, TInitialize>(config: dialog.IDialogConfig<TInitialize>): Promise<TResult>;
|
|
3039
3267
|
/**
|
|
3040
3268
|
* Gets the core API for custom commands.
|
|
3041
3269
|
* @i2since 1.0
|
|
@@ -4364,6 +4592,16 @@ export declare namespace toolview {
|
|
|
4364
4592
|
* @i2since 1.0
|
|
4365
4593
|
*/
|
|
4366
4594
|
removeEventListener<K extends keyof ToolViewApiEventMap>(type: K, listener: ToolViewApiEventMap[K]): void;
|
|
4595
|
+
/**
|
|
4596
|
+
* Opens a dialog with specified configuration.
|
|
4597
|
+
*
|
|
4598
|
+
* @param config - The information to create a modal dialog.
|
|
4599
|
+
* @typeParam TResult - The type of data when the dialog is submitted.
|
|
4600
|
+
* @typeParam TInitialize - The type of data to populate the dialog content.
|
|
4601
|
+
* @returns The value submitted from the dialog.
|
|
4602
|
+
* @i2since 1.4
|
|
4603
|
+
*/
|
|
4604
|
+
showDialog<TResult, TInitialize>(config: dialog.IDialogConfig<TInitialize>): Promise<TResult>;
|
|
4367
4605
|
}
|
|
4368
4606
|
/**
|
|
4369
4607
|
* A mapping of tool view event types to their listener types.
|
package/lib/index.js
CHANGED
|
@@ -39,3 +39,27 @@ export function getToolViewApi() {
|
|
|
39
39
|
scan();
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
+
//TODO: DOCs REVIEW
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the plug-in dialog API.
|
|
45
|
+
*
|
|
46
|
+
* @returns A promise that resolves to the dialog API.
|
|
47
|
+
* @throws `Error` (through the promise) if the version of the SDK was incompatible with the deployed version of i2 Notebook.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
* @i2since 1.4
|
|
51
|
+
*/
|
|
52
|
+
export function getDialogApi() {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
function scan() {
|
|
55
|
+
const api = window._i2GetPluginDialogApi;
|
|
56
|
+
if (api) {
|
|
57
|
+
clearInterval(handle);
|
|
58
|
+
const result = api(apiVersion);
|
|
59
|
+
resolve(result);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const handle = setInterval(scan, 50);
|
|
63
|
+
scan();
|
|
64
|
+
});
|
|
65
|
+
}
|