@i2analyze/notebook-sdk 1.10.0-dev.2 → 1.10.0-dev.4
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 +196 -0
- package/package.json +1 -1
|
@@ -728,6 +728,42 @@ export declare namespace app {
|
|
|
728
728
|
* @i2since 1.5
|
|
729
729
|
*/
|
|
730
730
|
setLabel(label: string | undefined): this;
|
|
731
|
+
/**
|
|
732
|
+
* Sets a badge icon in the given slot on the element.
|
|
733
|
+
*
|
|
734
|
+
* @param slot - The slot position (0 to 5). Slots 0 to 2 are trailing; slots 3 to 5 are leading.
|
|
735
|
+
* @param href - The URL of the badge icon image.
|
|
736
|
+
* @param description - A description of the badge, used as alternative text and in tooltips.
|
|
737
|
+
* @returns The element, with the badge icon in the specified slot set to the specified value.
|
|
738
|
+
* @i2since 1.10
|
|
739
|
+
*/
|
|
740
|
+
setBadge(slot: visual.BadgeSlot, href: string, description?: string): this;
|
|
741
|
+
/**
|
|
742
|
+
* Clears the badge icon in the given slot on the element.
|
|
743
|
+
*
|
|
744
|
+
* @remarks
|
|
745
|
+
* After this call, {@link visual.IElementStyleBase.getBadge | style.getBadge(slot)}
|
|
746
|
+
* returns `undefined` and {@link visual.IElementStyleBase.badges | style.badges}
|
|
747
|
+
* no longer includes an entry for the slot.
|
|
748
|
+
*
|
|
749
|
+
* @param slot - The slot position (0 to 5).
|
|
750
|
+
* @param href - `undefined` is the only valid argument for clearing the slot.
|
|
751
|
+
* @returns The element, with the badge icon in the specified slot cleared.
|
|
752
|
+
* @i2since 1.10
|
|
753
|
+
*/
|
|
754
|
+
setBadge(slot: visual.BadgeSlot, href: undefined): this;
|
|
755
|
+
/**
|
|
756
|
+
* Clears all badge icons on the element.
|
|
757
|
+
*
|
|
758
|
+
* @remarks
|
|
759
|
+
* After this call, {@link visual.IElementStyleBase.badges | style.badges} is
|
|
760
|
+
* empty and {@link visual.IElementStyleBase.getBadge | style.getBadge(slot)}
|
|
761
|
+
* returns `undefined` for every slot.
|
|
762
|
+
*
|
|
763
|
+
* @returns The element, with all badge icons cleared.
|
|
764
|
+
* @i2since 1.10
|
|
765
|
+
*/
|
|
766
|
+
clearBadges(): this;
|
|
731
767
|
}
|
|
732
768
|
/**
|
|
733
769
|
* A set of methods for modifying the appearance of a node.
|
|
@@ -2508,6 +2544,22 @@ export declare namespace commands {
|
|
|
2508
2544
|
* @i2since 1.0
|
|
2509
2545
|
*/
|
|
2510
2546
|
addGroup(group: IGroup): IActionArea<undefined>;
|
|
2547
|
+
/**
|
|
2548
|
+
* Adds a dynamic group whose commands are created on demand each time the group is opened.
|
|
2549
|
+
*
|
|
2550
|
+
* @remarks
|
|
2551
|
+
* Unlike {@link commands.IActionArea.addGroup}, the commands in a dynamic group are not created during plug-in
|
|
2552
|
+
* initialization. Instead, the {@link commands.IDynamicGroupConfig.onSurface} callback is called each time the
|
|
2553
|
+
* group is opened, allowing you to create commands that reflect the current application state.
|
|
2554
|
+
*
|
|
2555
|
+
* Dynamic groups are always collapsed — they render as a dropdown or submenu.
|
|
2556
|
+
*
|
|
2557
|
+
* @param config - The configuration for the dynamic group, including the `onSurface` callback.
|
|
2558
|
+
* @typeParam TCommandType - The type of the command, which determines the context passed to `onSurface`.
|
|
2559
|
+
* @throws `Error` if `config.id` is not a valid {@link commands.GroupId | GroupId}.
|
|
2560
|
+
* @i2since 1.10
|
|
2561
|
+
*/
|
|
2562
|
+
addDynamicGroup<TCommandType extends CommandType = CommandType>(config: IDynamicGroupConfig<TCommandType>): void;
|
|
2511
2563
|
/**
|
|
2512
2564
|
* Adds the specified group of actions to the user interface, or gets an existing group with the same identifier.
|
|
2513
2565
|
*
|
|
@@ -2731,6 +2783,108 @@ export declare namespace commands {
|
|
|
2731
2783
|
*/
|
|
2732
2784
|
export interface IMenuGroup extends IGroupBase {
|
|
2733
2785
|
}
|
|
2786
|
+
/**
|
|
2787
|
+
* Configuration for a dynamic group whose commands are created on demand when the group is opened.
|
|
2788
|
+
*
|
|
2789
|
+
* @remarks
|
|
2790
|
+
* A dynamic group solves the limitation that commands can only be created during plug-in initialization.
|
|
2791
|
+
* Instead, the {@link commands.IDynamicGroupConfig.onSurface} callback is called each time the group is
|
|
2792
|
+
* opened, allowing commands to be created based on the current application state.
|
|
2793
|
+
*
|
|
2794
|
+
* Dynamic groups are always collapsed — they render as a dropdown/submenu that opens on click.
|
|
2795
|
+
*
|
|
2796
|
+
* @typeParam TCommandType - The type of the command, which determines what context is passed to {@link commands.IDynamicGroupConfig.onSurface}.
|
|
2797
|
+
* @i2since 1.10
|
|
2798
|
+
*/
|
|
2799
|
+
export interface IDynamicGroupConfig<TCommandType extends CommandType = CommandType> {
|
|
2800
|
+
/**
|
|
2801
|
+
* Gets the identifier of the group, which should be a GUID. GUIDs are case-insensitive.
|
|
2802
|
+
* @i2since 1.10
|
|
2803
|
+
*/
|
|
2804
|
+
readonly id: GroupId;
|
|
2805
|
+
/**
|
|
2806
|
+
* Gets the label of the group, which is displayed as the button/menu-entry title.
|
|
2807
|
+
* @i2since 1.10
|
|
2808
|
+
*/
|
|
2809
|
+
readonly label: string;
|
|
2810
|
+
/**
|
|
2811
|
+
* Gets the icon of the group.
|
|
2812
|
+
* @i2since 1.10
|
|
2813
|
+
*/
|
|
2814
|
+
readonly icon?: IIcon;
|
|
2815
|
+
/**
|
|
2816
|
+
* Gets the command type, which determines what context is passed to {@link commands.IDynamicGroupConfig.onSurface}.
|
|
2817
|
+
* @i2since 1.10
|
|
2818
|
+
*/
|
|
2819
|
+
readonly type: TCommandType;
|
|
2820
|
+
/**
|
|
2821
|
+
* Populates the group's commands each time the group is opened.
|
|
2822
|
+
*
|
|
2823
|
+
* @param commandArea - A scoped area for creating and surfacing commands. Only commands created here are visible in this group.
|
|
2824
|
+
* @param context - The context based on type: `undefined` for `'unscoped'`, {@link commands.IRecordsContext} for `'records'`, the application object for `'application'`.
|
|
2825
|
+
* @param signal - An AbortSignal that is aborted when the group closes. Use it to cancel any async work started in this callback.
|
|
2826
|
+
* @returns An optional cleanup function that is called when the group closes, before the signal is aborted.
|
|
2827
|
+
* @i2since 1.10
|
|
2828
|
+
*/
|
|
2829
|
+
onSurface(commandArea: IDynamicActionArea, context: CommandPayloadMap[TCommandType], signal: AbortSignal): void | (() => void);
|
|
2830
|
+
}
|
|
2831
|
+
/**
|
|
2832
|
+
* A scoped area for creating and surfacing commands within a {@link commands.IDynamicGroupConfig.onSurface} callback.
|
|
2833
|
+
*
|
|
2834
|
+
* @remarks
|
|
2835
|
+
* Methods on this interface work like their equivalents on {@link commands.IActionArea}, but are scoped to the
|
|
2836
|
+
* current surface session. Commands created here exist only while the group is open and are automatically
|
|
2837
|
+
* unregistered when it closes.
|
|
2838
|
+
*
|
|
2839
|
+
* `getGroup` is restricted to groups created within the same `onSurface` call — it throws if you pass an
|
|
2840
|
+
* external group identifier.
|
|
2841
|
+
* @i2since 1.10
|
|
2842
|
+
*/
|
|
2843
|
+
export interface IDynamicActionArea extends Pick<ICommandApi, 'createCommand'> {
|
|
2844
|
+
/**
|
|
2845
|
+
* Returns an area positioned immediately before the specified action or group.
|
|
2846
|
+
* @param idOrCommand - The command, command identifier, or group identifier to use as a reference.
|
|
2847
|
+
* @returns A scoped area positioned before the specified item.
|
|
2848
|
+
* @i2since 1.10
|
|
2849
|
+
*/
|
|
2850
|
+
before(idOrCommand: CommandId | GroupId | ICommand): IDynamicActionArea;
|
|
2851
|
+
/**
|
|
2852
|
+
* Returns an area positioned immediately after the specified action or group.
|
|
2853
|
+
* @param idOrCommand - The command, command identifier, or group identifier to use as a reference.
|
|
2854
|
+
* @returns A scoped area positioned after the specified item.
|
|
2855
|
+
* @i2since 1.10
|
|
2856
|
+
*/
|
|
2857
|
+
after(idOrCommand: CommandId | GroupId | ICommand): IDynamicActionArea;
|
|
2858
|
+
/**
|
|
2859
|
+
* Returns an area scoped to a group created during this `onSurface` call.
|
|
2860
|
+
*
|
|
2861
|
+
* @param id - The identifier of a group created in this session.
|
|
2862
|
+
* @returns A scoped area for the contents of the group.
|
|
2863
|
+
* @throws `Error` if `id` refers to a group that was not created in this session.
|
|
2864
|
+
* @i2since 1.10
|
|
2865
|
+
*/
|
|
2866
|
+
getGroup(id: GroupId): IDynamicActionArea;
|
|
2867
|
+
/**
|
|
2868
|
+
* Adds a new group.
|
|
2869
|
+
* @param group - The group configuration.
|
|
2870
|
+
* @returns A scoped area for the contents of the new group.
|
|
2871
|
+
* @i2since 1.10
|
|
2872
|
+
*/
|
|
2873
|
+
addGroup(group: IGroup): IDynamicActionArea;
|
|
2874
|
+
/**
|
|
2875
|
+
* Adds a new group, or returns the existing one if it was already added during this `onSurface` call.
|
|
2876
|
+
* @param group - The group configuration.
|
|
2877
|
+
* @returns A scoped area for the contents of the new or existing group.
|
|
2878
|
+
* @i2since 1.10
|
|
2879
|
+
*/
|
|
2880
|
+
addOrGetGroup(group: IGroup): IDynamicActionArea;
|
|
2881
|
+
/**
|
|
2882
|
+
* Surfaces the specified commands in the group.
|
|
2883
|
+
* @param commandsOrCommandIds - The commands or command identifiers to surface.
|
|
2884
|
+
* @i2since 1.10
|
|
2885
|
+
*/
|
|
2886
|
+
surfaceCommands(...commandsOrCommandIds: (ICommand | CommandId)[]): void;
|
|
2887
|
+
}
|
|
2734
2888
|
/**
|
|
2735
2889
|
* A representation of a command in the user interface. An action is created when a command is surfaced.
|
|
2736
2890
|
* @i2since 1.0
|
|
@@ -6191,6 +6345,15 @@ export declare namespace visual {
|
|
|
6191
6345
|
* @i2since 1.9
|
|
6192
6346
|
*/
|
|
6193
6347
|
export type LineStyle = 'solid' | 'dashed' | 'dotted' | 'dash-dot' | 'dash-dot-dot';
|
|
6348
|
+
/**
|
|
6349
|
+
* The slot position of a badge icon on a node or edge.
|
|
6350
|
+
*
|
|
6351
|
+
* @remarks
|
|
6352
|
+
* Slots 0, 1, and 2 are trailing positions, displayed after the label of the element.
|
|
6353
|
+
* Slots 3, 4, and 5 are leading positions, displayed before the label of the element.
|
|
6354
|
+
* @i2since 1.10
|
|
6355
|
+
*/
|
|
6356
|
+
export type BadgeSlot = 0 | 1 | 2 | 3 | 4 | 5;
|
|
6194
6357
|
/**
|
|
6195
6358
|
* A label for an element.
|
|
6196
6359
|
* @i2since 1.5
|
|
@@ -6361,6 +6524,23 @@ export declare namespace visual {
|
|
|
6361
6524
|
* @i2since 1.2
|
|
6362
6525
|
*/
|
|
6363
6526
|
readonly color: IElementSetting<string>;
|
|
6527
|
+
/**
|
|
6528
|
+
* Gets the badge icons displayed on the element, in slot order.
|
|
6529
|
+
*
|
|
6530
|
+
* @remarks
|
|
6531
|
+
* The array contains one entry for each populated slot, ordered by slot number.
|
|
6532
|
+
* Empty if no badges are set on the element.
|
|
6533
|
+
* @i2since 1.10
|
|
6534
|
+
*/
|
|
6535
|
+
readonly badges: ReadonlyArray<IBadgeIcon>;
|
|
6536
|
+
/**
|
|
6537
|
+
* Gets the badge icon in the given slot.
|
|
6538
|
+
*
|
|
6539
|
+
* @param slot - The slot position to read.
|
|
6540
|
+
* @returns The badge icon in the slot, or `undefined` if the slot is empty.
|
|
6541
|
+
* @i2since 1.10
|
|
6542
|
+
*/
|
|
6543
|
+
getBadge(slot: BadgeSlot): IBadgeIcon | undefined;
|
|
6364
6544
|
}
|
|
6365
6545
|
/**
|
|
6366
6546
|
* An image for a node element.
|
|
@@ -6373,6 +6553,22 @@ export declare namespace visual {
|
|
|
6373
6553
|
*/
|
|
6374
6554
|
readonly isDefault: boolean;
|
|
6375
6555
|
}
|
|
6556
|
+
/**
|
|
6557
|
+
* A badge icon displayed alongside a node or edge in one of six slot positions.
|
|
6558
|
+
*
|
|
6559
|
+
* @remarks
|
|
6560
|
+
* Extends {@link data.IImage}, so `href` and `description` follow the same
|
|
6561
|
+
* convention as {@link visual.INodeStyle.image}. `description` is required
|
|
6562
|
+
* but may be the empty string.
|
|
6563
|
+
* @i2since 1.10
|
|
6564
|
+
*/
|
|
6565
|
+
export interface IBadgeIcon extends data.IImage {
|
|
6566
|
+
/**
|
|
6567
|
+
* Gets the slot position of the badge.
|
|
6568
|
+
* @i2since 1.10
|
|
6569
|
+
*/
|
|
6570
|
+
readonly slot: BadgeSlot;
|
|
6571
|
+
}
|
|
6376
6572
|
/**
|
|
6377
6573
|
* A style for a node, which affects its appearance.
|
|
6378
6574
|
* @i2since 1.0
|