@i2analyze/notebook-sdk 1.10.0-dev.9 → 1.11.0-dev.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/AGENTS.md +179 -0
- package/README.md +1 -0
- package/lib/gen/notebook-sdk-public.d.ts +617 -63
- package/lib/index.js +1 -1
- package/package.json +15 -13
package/AGENTS.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# AGENTS.md — i2 Notebook Web SDK
|
|
2
|
+
|
|
3
|
+
Guidance for AI coding assistants (Claude Code, Cursor, Copilot, etc.) writing i2 Analyst's
|
|
4
|
+
Notebook **web client plug-ins** with `@i2analyze/notebook-sdk`. Follow this over habits learned
|
|
5
|
+
from other SDKs. If a rule here conflicts with a code sample you found online, this file wins.
|
|
6
|
+
|
|
7
|
+
Docs: https://i2group.github.io/notebook-sdk/ · API reference: https://i2group.github.io/notebook-sdk/api/ · Machine-readable: https://i2group.github.io/notebook-sdk/llms.txt
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 0. The one rule that matters most: how to start a plug-in
|
|
12
|
+
|
|
13
|
+
**To create a NEW plug-in project, ALWAYS scaffold with the tool. Never hand-write a project
|
|
14
|
+
skeleton, and never copy a sample or tutorial as the starting boilerplate.**
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm create @i2analyze/notebook-plugin # or: npx @i2analyze/create-notebook-plugin
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Templates (pass `--template=`):
|
|
21
|
+
|
|
22
|
+
- `plugin` (default) — headless plug-in with an `entrypoint.ts`, no UI.
|
|
23
|
+
- `plugin-with-toolview` — adds a React tool view (`ToolView` component + `index.html`).
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npm create @i2analyze/notebook-plugin -- --template=plugin-with-toolview
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The scaffold wires up TypeScript, ESLint, Prettier, webpack production bundling, the dev proxy
|
|
30
|
+
(`devproxy.json`), and a correct `plugin.json` manifest. Reproducing this by hand gets the manifest,
|
|
31
|
+
CSP, version pinning, and build config subtly wrong.
|
|
32
|
+
|
|
33
|
+
> ❌ **Do NOT** treat `samples/basic-plugin` or the guide page **"Creating a basic plug-in for the
|
|
34
|
+
> i2 Web Client"** (`tutorials/basic-plugin.md`) as the recommended boilerplate. Those exist to
|
|
35
|
+
> *explain concepts from first principles*. The recommended path for real plug-ins is the
|
|
36
|
+
> **`create-notebook-plugin` tool** and its tutorial (`tutorials/create-notebook-plugin.md`).
|
|
37
|
+
> When a user asks you to "make a plug-in", scaffold with the tool, then edit `src/entrypoint.ts`.
|
|
38
|
+
|
|
39
|
+
If you cannot run the scaffolder (e.g. offline), say so explicitly and reproduce the generated
|
|
40
|
+
`plugin/` template structure faithfully rather than inventing a layout.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 1. Mental model
|
|
45
|
+
|
|
46
|
+
A plug-in is static assets (JS + a `plugin.json` manifest) served to the i2 Web Client. Three parts:
|
|
47
|
+
|
|
48
|
+
1. **Manifest** (`public/plugin.json`) — identity (`pluginId`, `name`, `pluginVersion`), the
|
|
49
|
+
`entryPointUrl`, and CSP. Schema:
|
|
50
|
+
`https://i2group.github.io/notebook-sdk/schemas/plugin-manifest.json` (keep the `$schema` line —
|
|
51
|
+
it gives editors and agents live validation).
|
|
52
|
+
2. **Entry point** (`src/entrypoint.ts`) — runs on load. Acquires the versioned API, registers
|
|
53
|
+
capabilities (commands, tool views), then calls `api.initializationComplete()`.
|
|
54
|
+
3. **Tool views** (optional) — iframed HTML/JS UIs (React in the template) for richer interaction.
|
|
55
|
+
|
|
56
|
+
## 2. Acquiring the API — the version you request is a minimum, not "your SDK version"
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { NotebookStatic } from '@i2analyze/notebook-sdk';
|
|
60
|
+
declare const notebook: NotebookStatic;
|
|
61
|
+
|
|
62
|
+
async function main() {
|
|
63
|
+
const api = await notebook.getEntryPointApi('<your-plugin-id>', '1.3'); // minimum API version required
|
|
64
|
+
// ...register capabilities...
|
|
65
|
+
api.initializationComplete();
|
|
66
|
+
}
|
|
67
|
+
main();
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- The `major.minor` you pass is the **minimum API version your plug-in needs from the deployed
|
|
71
|
+
i2 Notebook backend** — *not* the version of the SDK you happened to install. The call asks the
|
|
72
|
+
running server "do you serve a client that supports at least this API version?" and **rejects** if
|
|
73
|
+
the server is older than requested (or if `pluginId` is absent from the manifest).
|
|
74
|
+
- **Choose the lowest version that includes every API you actually use.** A lower number runs on a
|
|
75
|
+
wider range of i2 Analyze servers; a higher number requires a newer server but unlocks newer APIs.
|
|
76
|
+
See the SDK ↔ i2 Analyze compatibility table in the *SDK and API versioning* guide.
|
|
77
|
+
- Ceiling: it can't exceed the API version of the installed `@i2analyze/notebook-sdk` (you can only
|
|
78
|
+
call types the SDK ships). Within that ceiling, prefer the floor. The `create-notebook-plugin`
|
|
79
|
+
scaffold sets a deliberately low default (currently `1.3`) for broad compatibility — only raise it
|
|
80
|
+
when you adopt an API introduced in a later version. **Do not "upgrade" it to match the SDK.**
|
|
81
|
+
- (The templates use the unbundled global `notebook`, so you choose the version explicitly. If you
|
|
82
|
+
instead `import { getEntryPointApi }` from the SDK and bundle it, that entry point uses the SDK's
|
|
83
|
+
own version automatically.)
|
|
84
|
+
- Keep the `pluginId` identical in code and manifest.
|
|
85
|
+
- You **must** call `api.initializationComplete()` once setup is done, or the plug-in never finishes loading.
|
|
86
|
+
|
|
87
|
+
## 3. Commands (the primary way to add behaviour)
|
|
88
|
+
|
|
89
|
+
Create with `api.commands.createCommand({...})`, then *surface* it into one or more UI locations.
|
|
90
|
+
Command `type` scopes the execution context: `'unscoped'`, `'records'`, etc. The scaffold uses
|
|
91
|
+
`'unscoped'`; switch to `'records'` when you act on the current selection.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
const cmd = api.commands.createCommand({
|
|
95
|
+
id: 'view-on-map',
|
|
96
|
+
name: 'View on map',
|
|
97
|
+
icon: { type: 'inlineSvg', svg: commandSvg },
|
|
98
|
+
type: 'records',
|
|
99
|
+
onExecute(payload: commands.IRecordsContext) { /* ... */ },
|
|
100
|
+
onSurface(action, eventApi, signal) {
|
|
101
|
+
// Control enablement per surfacing. dispatchNow runs the callback immediately;
|
|
102
|
+
// forwarding `signal` auto-unsubscribes when this surfacing is removed.
|
|
103
|
+
eventApi.addEventListener('recordscontextchange',
|
|
104
|
+
(ctx) => action.setEnabled(/* predicate over ctx.records */ true),
|
|
105
|
+
{ dispatchNow: true, signal });
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
api.commands.applicationRibbon.homeTab.surfaceCommands(cmd);
|
|
110
|
+
api.commands.chartPopupMenu.surfaceCommands(cmd); // same command, multiple places
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Best practice:** gate enablement in `onSurface` via events rather than leaving buttons always-on;
|
|
114
|
+
always forward `signal` to listeners so they clean up on unsurface.
|
|
115
|
+
|
|
116
|
+
## 4. Reading data
|
|
117
|
+
|
|
118
|
+
Access via the versioned `data` / `records` / `chart` namespaces. Records expose typed properties
|
|
119
|
+
through their `itemType`.
|
|
120
|
+
|
|
121
|
+
- Iterate `record.itemType.propertyTypes`; read with `record.getProperty(propertyType)`.
|
|
122
|
+
- **Check `record.isValueUnfetched(property)` before use** — the client lazily loads values, and an
|
|
123
|
+
unfetched value is not the same as an empty one. See guide: *Unfetched property values*.
|
|
124
|
+
- Collections are `data.IReadOnlyCollection<T>` (use `.size`, `.firstOrDefault(undefined)`), not JS arrays.
|
|
125
|
+
|
|
126
|
+
## 5. Changing data — tracked vs untracked mutations
|
|
127
|
+
|
|
128
|
+
All writes go through a mutation callback; never mutate model objects directly.
|
|
129
|
+
|
|
130
|
+
- **`runTrackedMutations`** — for changes that modify data (add/edit/delete records, notes, etc.).
|
|
131
|
+
These are undoable and validated. Return `{ type: 'commit' }` or `{ type: 'rollback' }`.
|
|
132
|
+
- **`runUntrackedMutations`** — for view-only changes that don't touch data, e.g. selection or
|
|
133
|
+
untracked element style. Lighter weight; not part of undo history.
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
await api.runTrackedMutations(async (application, mutations, cancelation) => {
|
|
137
|
+
if (application.chart.selection.records.size === 0) return { type: 'rollback' }; // no-op, not an error
|
|
138
|
+
const id = mutations.addEntityRecord({ itemType, properties: {}, notes: [], security, sourceReferences: [] });
|
|
139
|
+
return { type: 'commit' };
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Guides: *Changing data from a plug-in*, *Supported mutation operations*, *Untracked element style editing*.
|
|
144
|
+
|
|
145
|
+
## 6. Dev loop, build, deploy
|
|
146
|
+
|
|
147
|
+
- `npm run dev` — dev server + `notebook-sdk-plugin-proxy` (proxies to your i2 Analyze server; edit
|
|
148
|
+
`devproxy.json` to change the target). Open the Web Client and look for your ribbon button /
|
|
149
|
+
console message.
|
|
150
|
+
- `npm run build` — production webpack bundle into `dist/`.
|
|
151
|
+
- **Deploy:** copy `dist/` into the server's
|
|
152
|
+
`toolkit/configuration/fragments/opal-services/plugins/<your-plugin>/`, then
|
|
153
|
+
`setup -t stopLiberty && setup -t deployLiberty && setup -t startLiberty` (repeat on every Liberty
|
|
154
|
+
node in HA). Guide: *Deploying to an i2 Analyze server*.
|
|
155
|
+
|
|
156
|
+
## 7. Versioned API namespaces
|
|
157
|
+
|
|
158
|
+
Import types from `@i2analyze/notebook-sdk`; the runtime API is grouped into:
|
|
159
|
+
`app`, `chart`, `commands`, `data`, `dialog`, `records`, `schema`, `toolview`, `visual`
|
|
160
|
+
(plus `ILogger`, `IEntryPointApi`, `LogLevel`). Prefer these typed namespaces over `any`.
|
|
161
|
+
|
|
162
|
+
## 8. Footguns / anti-patterns
|
|
163
|
+
|
|
164
|
+
- ❌ Hand-rolling the project or copying `basic-plugin` — see §0.
|
|
165
|
+
- ❌ Guessing the API version, or letting manifest `pluginId` drift from the code id.
|
|
166
|
+
- ❌ Forgetting `api.initializationComplete()`.
|
|
167
|
+
- ❌ Reading a property without an `isValueUnfetched` check.
|
|
168
|
+
- ❌ Using `runTrackedMutations` for selection-only changes (use untracked), or mutating model objects outside a mutation callback.
|
|
169
|
+
- ❌ Leaving commands always-enabled instead of gating in `onSurface`.
|
|
170
|
+
- ⚠️ Before relying on a member, check its `@i2since` tag in the API reference: it names the API
|
|
171
|
+
version that introduced it. If you use it, the plug-in's requested minimum version (§2) must be at
|
|
172
|
+
least that value. The public API is a single stable surface — there are no `@beta`/`@alpha` tiers.
|
|
173
|
+
|
|
174
|
+
## 9. When unsure
|
|
175
|
+
|
|
176
|
+
Prefer these accurate sources over memory: the API reference
|
|
177
|
+
(https://i2group.github.io/notebook-sdk/api/), the guide, the `samples/` directory, and
|
|
178
|
+
`packages/notebook-sdk/src/use-the-api.ts` (worked mutation examples). For machine ingestion, fetch
|
|
179
|
+
`https://i2group.github.io/notebook-sdk/llms-full.txt`.
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ This npm package provides the JavaScript library for developing plug-ins and a t
|
|
|
8
8
|
|
|
9
9
|
| `@i2analyze/notebook-sdk` version | i2 Analyze version |
|
|
10
10
|
| --------------------------------- | ------------------ |
|
|
11
|
+
| 1.10.\* | 4.4.8.\* and later |
|
|
11
12
|
| 1.9.\* | 4.4.7.\* and later |
|
|
12
13
|
| 1.8.\* | 4.4.6.\* and later |
|
|
13
14
|
| 1.7.\* | 4.4.5.\* and later |
|
|
@@ -68,10 +68,11 @@ export declare namespace app {
|
|
|
68
68
|
*/
|
|
69
69
|
readonly serverComponents: IServerComponents;
|
|
70
70
|
/**
|
|
71
|
-
* Queues a function that performs tracked mutations on the application contents
|
|
72
|
-
* and can respond to the changes that the mutations cause.
|
|
71
|
+
* Queues a function that performs tracked mutations on the application contents.
|
|
73
72
|
*
|
|
74
73
|
* @remarks
|
|
74
|
+
* The mutations are performed at the next available opportunity, and can respond to the changes that they cause.
|
|
75
|
+
*
|
|
75
76
|
* A mutation is an operation that can read or modify the contents of the application.
|
|
76
77
|
* A successful set of _tracked_ mutations is added as a single entry to the undo stack.
|
|
77
78
|
*
|
|
@@ -97,10 +98,11 @@ export declare namespace app {
|
|
|
97
98
|
*/
|
|
98
99
|
runTrackedMutations(mutationHandler: TrackedMutationHandler, options?: ITransactionOptions): Promise<IMutationResult>;
|
|
99
100
|
/**
|
|
100
|
-
* Queues a function that performs untracked mutations on the application contents
|
|
101
|
-
* and can respond to the changes that the mutations cause.
|
|
101
|
+
* Queues a function that performs untracked mutations on the application contents.
|
|
102
102
|
*
|
|
103
103
|
* @remarks
|
|
104
|
+
* The mutations are performed at the next available opportunity, and can respond to the changes that they cause.
|
|
105
|
+
*
|
|
104
106
|
* A mutation is an operation that can read or modify the contents of the application.
|
|
105
107
|
* _Untracked_ mutations are not added to the undo stack, and therefore cannot be undone.
|
|
106
108
|
*
|
|
@@ -432,6 +434,8 @@ export declare namespace app {
|
|
|
432
434
|
*
|
|
433
435
|
* @remarks
|
|
434
436
|
*
|
|
437
|
+
* The effect depends on the chosen option:
|
|
438
|
+
*
|
|
435
439
|
* `addRecordsToSelection` adds the records from the group to the current selection;
|
|
436
440
|
* `setSelectionToRecords` sets the selection to the records from the group;
|
|
437
441
|
* `setSelectionToNewRecords` sets the selection to records from the group that were not already on the chart.
|
|
@@ -823,11 +827,11 @@ export declare namespace app {
|
|
|
823
827
|
* A set of methods for modifying the appearance of a node.
|
|
824
828
|
* @i2since 1.2
|
|
825
829
|
*/
|
|
826
|
-
export interface INodeEditor extends
|
|
830
|
+
export interface INodeEditor extends IElementEditorBase {
|
|
827
831
|
/**
|
|
828
832
|
* Sets or resets the color of the element.
|
|
829
833
|
*
|
|
830
|
-
* @param color - The color to set, or `undefined` to reset the color to the theme default, or
|
|
834
|
+
* @param color - The color to set, or `undefined` to reset the color to the theme default, or `null` to remove the color.
|
|
831
835
|
* @returns The element, with its color set to the specified value.
|
|
832
836
|
* @throws `Error` if the specified value is not in a form that CSS supports, such as a hexadecimal number, an `rgb()` value, or a color name.
|
|
833
837
|
* @i2since 1.2
|
|
@@ -1263,6 +1267,36 @@ export declare namespace app {
|
|
|
1263
1267
|
* @i2since 1.8
|
|
1264
1268
|
*/
|
|
1265
1269
|
addNodeGroup(nodes: Iterable<NodeSpecifier>): IPendingNodeGroup;
|
|
1270
|
+
/**
|
|
1271
|
+
* Gets an object with methods for hinting the appearance of a new entity record's node.
|
|
1272
|
+
*
|
|
1273
|
+
* @remarks
|
|
1274
|
+
* The record must be a pending record that was created earlier in the same mutation by a call to
|
|
1275
|
+
* {@link app.ITrackedMutations.addEntityRecord}. The hints are applied to the node as the server
|
|
1276
|
+
* creates it, so that the node does not first appear with its default appearance and then change.
|
|
1277
|
+
* If you do not call this method for a record, the server creates a node with the default
|
|
1278
|
+
* appearance.
|
|
1279
|
+
*
|
|
1280
|
+
* @param record - The pending entity record whose node is to be hinted.
|
|
1281
|
+
* @returns An object with methods for hinting the appearance of the node.
|
|
1282
|
+
* @i2since 1.10
|
|
1283
|
+
*/
|
|
1284
|
+
createNode(record: IPendingRecord): INodeEditor;
|
|
1285
|
+
/**
|
|
1286
|
+
* Gets an object with methods for hinting the appearance of a new link record's edge.
|
|
1287
|
+
*
|
|
1288
|
+
* @remarks
|
|
1289
|
+
* The record must be a pending record that was created earlier in the same mutation by a call to
|
|
1290
|
+
* {@link app.ITrackedMutations.addLinkRecord}. The hints are applied to the edge as the server
|
|
1291
|
+
* creates it, so that the edge does not first appear with its default appearance and then change.
|
|
1292
|
+
* If you do not call this method for a record, the server creates an edge with the default
|
|
1293
|
+
* appearance.
|
|
1294
|
+
*
|
|
1295
|
+
* @param record - The pending link record whose edge is to be hinted.
|
|
1296
|
+
* @returns An object with methods for hinting the appearance of the edge.
|
|
1297
|
+
* @i2since 1.10
|
|
1298
|
+
*/
|
|
1299
|
+
createEdge(record: IPendingRecord): IEdgeEditor;
|
|
1266
1300
|
/**
|
|
1267
1301
|
* Gets an object with methods for editing a record.
|
|
1268
1302
|
*
|
|
@@ -1755,6 +1789,20 @@ export declare namespace chart {
|
|
|
1755
1789
|
* @i2since 1.0
|
|
1756
1790
|
*/
|
|
1757
1791
|
readonly name: string;
|
|
1792
|
+
/**
|
|
1793
|
+
* Indicates whether the chart is read-only for the current user.
|
|
1794
|
+
*
|
|
1795
|
+
* @remarks
|
|
1796
|
+
* A chart is read-only when the current user opened it as a read-only snapshot, for example because they
|
|
1797
|
+
* have view-only access to it, or because another user is editing it. The value is fixed for as long as the
|
|
1798
|
+
* chart remains open; the user must reopen the chart to change it.
|
|
1799
|
+
*
|
|
1800
|
+
* On a read-only chart, the application rolls back any mutation that would change the chart.
|
|
1801
|
+
* The mutation does not report an error; its promise resolves with a result that contains no changes.
|
|
1802
|
+
* Changes to the selection and to the view of the chart still apply for the current user.
|
|
1803
|
+
* @i2since 1.10
|
|
1804
|
+
*/
|
|
1805
|
+
readonly isReadOnly: boolean;
|
|
1758
1806
|
/**
|
|
1759
1807
|
* Gets the schema of the chart, which describes the types and properties that records in the chart can have.
|
|
1760
1808
|
* @i2since 1.0
|
|
@@ -1982,6 +2030,17 @@ export declare namespace chart {
|
|
|
1982
2030
|
*/
|
|
1983
2031
|
readonly removed: data.IReadOnlyCollection<data.SourceReferenceId>;
|
|
1984
2032
|
};
|
|
2033
|
+
/**
|
|
2034
|
+
* Gets a value that indicates whether the direction of a link record changed.
|
|
2035
|
+
*
|
|
2036
|
+
* @remarks
|
|
2037
|
+
* This field is present, with a value of `true`, only for link records whose
|
|
2038
|
+
* {@link records.IChartLinkRecord.linkDirection | linkDirection} differs from its previous value.
|
|
2039
|
+
* The field is absent for entity records, and for link records whose direction is unchanged.
|
|
2040
|
+
*
|
|
2041
|
+
* @i2since 1.10
|
|
2042
|
+
*/
|
|
2043
|
+
readonly direction?: true;
|
|
1985
2044
|
}
|
|
1986
2045
|
/**
|
|
1987
2046
|
* A change that has occurred to the data in a chart.
|
|
@@ -2377,6 +2436,63 @@ export declare namespace commands {
|
|
|
2377
2436
|
* @i2since 1.9
|
|
2378
2437
|
*/
|
|
2379
2438
|
export type GroupType = 'expanded' | 'collapsed' | 'command' | 'stacked';
|
|
2439
|
+
/**
|
|
2440
|
+
* The state of the keyboard modifier keys at the point at which a command was triggered.
|
|
2441
|
+
* @i2since 1.10
|
|
2442
|
+
*/
|
|
2443
|
+
export interface IModifierKeys {
|
|
2444
|
+
/**
|
|
2445
|
+
* Indicates whether the <kbd>Ctrl</kbd> key was held when the command was triggered.
|
|
2446
|
+
* @i2since 1.10
|
|
2447
|
+
*/
|
|
2448
|
+
readonly ctrl: boolean;
|
|
2449
|
+
/**
|
|
2450
|
+
* Indicates whether the <kbd>Shift</kbd> key was held when the command was triggered.
|
|
2451
|
+
* @i2since 1.10
|
|
2452
|
+
*/
|
|
2453
|
+
readonly shift: boolean;
|
|
2454
|
+
/**
|
|
2455
|
+
* Indicates whether the <kbd>Alt</kbd> key (<kbd>Option</kbd> on macOS) was held when the command was triggered.
|
|
2456
|
+
* @i2since 1.10
|
|
2457
|
+
*/
|
|
2458
|
+
readonly alt: boolean;
|
|
2459
|
+
/**
|
|
2460
|
+
* Indicates whether the meta key (<kbd>Command</kbd> on macOS, the Windows key on Windows) was held when the
|
|
2461
|
+
* command was triggered.
|
|
2462
|
+
* @i2since 1.10
|
|
2463
|
+
*/
|
|
2464
|
+
readonly meta: boolean;
|
|
2465
|
+
}
|
|
2466
|
+
/**
|
|
2467
|
+
* Context that describes where and how a command was triggered.
|
|
2468
|
+
*
|
|
2469
|
+
* @remarks
|
|
2470
|
+
* This context is mixed into the payload that every command receives. Its members are populated when the
|
|
2471
|
+
* command is triggered from a position on the chart, such as when a pop-up (right-click) menu is opened.
|
|
2472
|
+
* They are `undefined` when the command is triggered without a positional origin, for example from a ribbon
|
|
2473
|
+
* or programmatically.
|
|
2474
|
+
* @i2since 1.10
|
|
2475
|
+
*/
|
|
2476
|
+
export interface ICommandInvocationContext {
|
|
2477
|
+
/**
|
|
2478
|
+
* Gets the position on the chart at which the command was triggered, in chart coordinates.
|
|
2479
|
+
*
|
|
2480
|
+
* @remarks
|
|
2481
|
+
* This is `undefined` if the command was triggered without a positional origin. For example, when a
|
|
2482
|
+
* command is invoked from a pop-up (right-click) menu, this is the position on the chart at which the
|
|
2483
|
+
* menu was opened.
|
|
2484
|
+
* @i2since 1.10
|
|
2485
|
+
*/
|
|
2486
|
+
readonly triggerPosition?: visual.IPosition;
|
|
2487
|
+
/**
|
|
2488
|
+
* Gets the state of the keyboard modifier keys at the point at which the command was triggered.
|
|
2489
|
+
*
|
|
2490
|
+
* @remarks
|
|
2491
|
+
* This is `undefined` if the command was not triggered by a user input event.
|
|
2492
|
+
* @i2since 1.10
|
|
2493
|
+
*/
|
|
2494
|
+
readonly modifierKeys?: IModifierKeys;
|
|
2495
|
+
}
|
|
2380
2496
|
/**
|
|
2381
2497
|
* A mapping of command types to their payload types.
|
|
2382
2498
|
* @i2since 1.0
|
|
@@ -2398,6 +2514,20 @@ export declare namespace commands {
|
|
|
2398
2514
|
*/
|
|
2399
2515
|
readonly unscoped: void;
|
|
2400
2516
|
}
|
|
2517
|
+
/**
|
|
2518
|
+
* A mapping of command types to the payload that their {@link commands.ICommandConfig.onExecute}
|
|
2519
|
+
* callback receives.
|
|
2520
|
+
*
|
|
2521
|
+
* @remarks
|
|
2522
|
+
* This is the command's base payload from {@link commands.CommandPayloadMap} combined with the
|
|
2523
|
+
* {@link commands.ICommandInvocationContext} that describes where and how the command was triggered.
|
|
2524
|
+
* Unlike {@link commands.CommandPayloadMap}, which also types the `onPopulate` callback of a dynamic
|
|
2525
|
+
* group, this mapping applies only when a command is executed.
|
|
2526
|
+
* @i2since 1.10
|
|
2527
|
+
*/
|
|
2528
|
+
export type CommandExecutePayloadMap = {
|
|
2529
|
+
readonly [TCommandType in CommandType]: CommandPayloadMap[TCommandType] extends void ? ICommandInvocationContext : CommandPayloadMap[TCommandType] & ICommandInvocationContext;
|
|
2530
|
+
};
|
|
2401
2531
|
/**
|
|
2402
2532
|
* A mapping of command types to the event types that are available to a surfaced command.
|
|
2403
2533
|
* @i2since 1.0
|
|
@@ -2524,10 +2654,16 @@ export declare namespace commands {
|
|
|
2524
2654
|
/**
|
|
2525
2655
|
* Runs when the command is executed.
|
|
2526
2656
|
*
|
|
2527
|
-
* @
|
|
2657
|
+
* @remarks
|
|
2658
|
+
* For "records" and "application" commands, the single payload argument combines the base payload
|
|
2659
|
+
* for the command type with the {@link commands.ICommandInvocationContext} that describes where and
|
|
2660
|
+
* how the command was triggered. For "unscoped" commands the invocation context is the only
|
|
2661
|
+
* argument and is optional, so the callback can be defined and invoked with no arguments.
|
|
2662
|
+
* @param args - The command payload for "records" and "application" commands, or the optional
|
|
2663
|
+
* invocation context for "unscoped" commands, as determined by the command type.
|
|
2528
2664
|
* @i2since 1.0
|
|
2529
2665
|
*/
|
|
2530
|
-
onExecute(payload:
|
|
2666
|
+
onExecute(...args: TCommandType extends 'unscoped' ? [invocationContext?: CommandExecutePayloadMap['unscoped']] : [payload: CommandExecutePayloadMap[TCommandType]]): void;
|
|
2531
2667
|
/**
|
|
2532
2668
|
* Runs when an action derived from the command is surfaced, enabling the command to configure the action in response to events.
|
|
2533
2669
|
*
|
|
@@ -2618,7 +2754,7 @@ export declare namespace commands {
|
|
|
2618
2754
|
* Adds the specified group of actions to the user interface.
|
|
2619
2755
|
*
|
|
2620
2756
|
* @param group - The group to add.
|
|
2621
|
-
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.
|
|
2757
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.IGroupConfigBase.onSurface}.
|
|
2622
2758
|
* @returns An object that you can use to add actions or a further group to the new group.
|
|
2623
2759
|
* @throws `Error` if the `group` was not valid, or if a group with the same {@link commands.GroupId} was already present.
|
|
2624
2760
|
* @i2since 1.0
|
|
@@ -2629,10 +2765,11 @@ export declare namespace commands {
|
|
|
2629
2765
|
*
|
|
2630
2766
|
* @remarks
|
|
2631
2767
|
* Unlike {@link commands.IActionArea.addGroup}, the commands in a dynamic group are not created during plug-in
|
|
2632
|
-
* initialization. Instead, the {@link commands.
|
|
2768
|
+
* initialization. Instead, the {@link commands.IDynamicGroupConfigBase.onPopulate} callback is called each time the
|
|
2633
2769
|
* group is opened, allowing you to create commands that reflect the current application state.
|
|
2634
2770
|
*
|
|
2635
|
-
*
|
|
2771
|
+
* A dynamic group renders as a popup, never inline: by default a collapsed dropdown/submenu, or — when
|
|
2772
|
+
* `config.type` is `'command'` with a `primaryCommand` — a split button whose dropdown is populated on open.
|
|
2636
2773
|
*
|
|
2637
2774
|
* @param config - The configuration for the dynamic group, including the `onPopulate` callback.
|
|
2638
2775
|
* @typeParam TCommandType - The type of the command-context for the group, which determines what payload is passed to `onPopulate` and what event API is passed to `onSurface`.
|
|
@@ -2649,7 +2786,7 @@ export declare namespace commands {
|
|
|
2649
2786
|
* plug-ins that want to use the same group, and these plug-ins can be deployed independently, then you should use this method.
|
|
2650
2787
|
*
|
|
2651
2788
|
* @param group - The group to add or get.
|
|
2652
|
-
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.
|
|
2789
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.IGroupConfigBase.onSurface}.
|
|
2653
2790
|
* @returns An object that you can use to add actions or a further group to the new or existing group.
|
|
2654
2791
|
* @throws `Error` if the `group` was not valid, or if it was added before by the same plug-in.
|
|
2655
2792
|
* @i2since 1.0
|
|
@@ -2841,21 +2978,24 @@ export declare namespace commands {
|
|
|
2841
2978
|
* Indicates whether the group is initially expanded (`false`) or collapsed (`true`) in the user interface.
|
|
2842
2979
|
*
|
|
2843
2980
|
* @remarks
|
|
2844
|
-
* This is deprecated in favour of the more explicit {@link commands.
|
|
2981
|
+
* This is deprecated in favour of the more explicit {@link commands.IStandardGroup."type"} property.
|
|
2845
2982
|
* When migrating, use `type: 'collapsed'` instead of `isCollapsed: true`, and `type: 'expanded'` instead of
|
|
2846
2983
|
* `isCollapsed: false` or omitting the property.
|
|
2847
|
-
* @deprecated Deprecated since version 1.9. Use {@link commands.
|
|
2984
|
+
* @deprecated Deprecated since version 1.9. Use {@link commands.IStandardGroup."type"} instead.
|
|
2848
2985
|
* @i2since 1.5
|
|
2849
2986
|
*/
|
|
2850
2987
|
readonly isCollapsed?: boolean;
|
|
2851
2988
|
}
|
|
2852
2989
|
/**
|
|
2853
|
-
*
|
|
2990
|
+
* Configuration shared by the {@link commands.IGroup} variants.
|
|
2854
2991
|
*
|
|
2855
|
-
* @
|
|
2992
|
+
* @remarks
|
|
2993
|
+
* The fields common to the non-split {@link commands.IStandardGroup} and the split-button
|
|
2994
|
+
* {@link commands.ICommandGroup}.
|
|
2995
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to {@link commands.IGroupConfigBase.onSurface}. Defaults to `'unscoped'`.
|
|
2856
2996
|
* @i2since 1.0
|
|
2857
2997
|
*/
|
|
2858
|
-
export interface
|
|
2998
|
+
export interface IGroupConfigBase<TCommandType extends CommandType = 'unscoped'> extends IGroupBase {
|
|
2859
2999
|
/**
|
|
2860
3000
|
* Gets the icon of the group, which is displayed if the group is collapsed.
|
|
2861
3001
|
* @i2since 1.0
|
|
@@ -2874,20 +3014,6 @@ export declare namespace commands {
|
|
|
2874
3014
|
* @i2since 1.0
|
|
2875
3015
|
*/
|
|
2876
3016
|
readonly label?: string;
|
|
2877
|
-
/**
|
|
2878
|
-
* Gets the render type of the group.
|
|
2879
|
-
*
|
|
2880
|
-
* @remarks
|
|
2881
|
-
* Use this property to explicitly control how the group is presented in the user interface. The options are:
|
|
2882
|
-
* - `'expanded'` - shows all commands inline (default)
|
|
2883
|
-
* - `'collapsed'` - shows the group as a single icon/label button that opens a dropdown
|
|
2884
|
-
* - `'command'` - indicates the group exposes a primary action (the first surfaced command) while also presenting a menu of related actions; user may render this as a split button in a ribbon, or as an actionable menu entry with a submenu in popup menus.
|
|
2885
|
-
* - `'stacked'` - renders the group's children as a vertical column of small (icon + label) buttons that expand inline in the ribbon. A stacked group behaves like an `'expanded'` group but with a compact visual layout; it can collapse under overflow pressure. In popup menus the children render as normal menu items below the group's section-header label.
|
|
2886
|
-
*
|
|
2887
|
-
* If `type` is specified it takes precedence over the deprecated {@link commands.IGroupBase.isCollapsed} boolean.
|
|
2888
|
-
* @i2since 1.9
|
|
2889
|
-
*/
|
|
2890
|
-
readonly type?: GroupType;
|
|
2891
3017
|
/**
|
|
2892
3018
|
* Gets the popup style for the group's trigger button.
|
|
2893
3019
|
*
|
|
@@ -2903,11 +3029,11 @@ export declare namespace commands {
|
|
|
2903
3029
|
*/
|
|
2904
3030
|
readonly popoutStyle?: 'ribbon';
|
|
2905
3031
|
/**
|
|
2906
|
-
* Gets the command-context type, which determines what event API is passed to {@link commands.
|
|
3032
|
+
* Gets the command-context type, which determines what event API is passed to {@link commands.IGroupConfigBase.onSurface}.
|
|
2907
3033
|
*
|
|
2908
3034
|
* @remarks
|
|
2909
|
-
* Mirrors {@link commands.
|
|
2910
|
-
* Defaults to `'unscoped'`, which means {@link commands.
|
|
3035
|
+
* Mirrors {@link commands.IDynamicGroupConfigBase.context} (and, by analogy, {@link commands.ICommandConfig."type"}).
|
|
3036
|
+
* Defaults to `'unscoped'`, which means {@link commands.IGroupConfigBase.onSurface} receives no event API.
|
|
2911
3037
|
* @i2since 1.10
|
|
2912
3038
|
*/
|
|
2913
3039
|
readonly context?: TCommandType;
|
|
@@ -2933,6 +3059,80 @@ export declare namespace commands {
|
|
|
2933
3059
|
*/
|
|
2934
3060
|
onSurface?(groupAction: IGroupAction, eventApi: CommandEventsMap[TCommandType], signal: AbortSignal): void | (() => void);
|
|
2935
3061
|
}
|
|
3062
|
+
/**
|
|
3063
|
+
* A non-split group of actions: rendered inline (`'expanded'`), as a single dropdown button
|
|
3064
|
+
* (`'collapsed'`), or as a stacked column (`'stacked'`).
|
|
3065
|
+
*
|
|
3066
|
+
* @typeParam TCommandType - The type of the command-context for the group. Defaults to `'unscoped'`.
|
|
3067
|
+
* @i2since 1.0
|
|
3068
|
+
*/
|
|
3069
|
+
export interface IStandardGroup<TCommandType extends CommandType = 'unscoped'> extends IGroupConfigBase<TCommandType> {
|
|
3070
|
+
/**
|
|
3071
|
+
* Gets the render type of the group.
|
|
3072
|
+
*
|
|
3073
|
+
* @remarks
|
|
3074
|
+
* Use this property to explicitly control how the group is presented in the user interface. The options are:
|
|
3075
|
+
* - `'expanded'` - shows all commands inline (default)
|
|
3076
|
+
* - `'collapsed'` - shows the group as a single icon/label button that opens a dropdown
|
|
3077
|
+
* - `'stacked'` - renders the group's children as a vertical column of small (icon + label) buttons that expand inline in the ribbon. A stacked group behaves like an `'expanded'` group but with a compact visual layout; it can collapse under overflow pressure. In popup menus the children render as normal menu items below the group's section-header label.
|
|
3078
|
+
*
|
|
3079
|
+
* For a split button that has a primary command, use {@link commands.ICommandGroup} (`type: 'command'`).
|
|
3080
|
+
* If `type` is specified it takes precedence over the deprecated {@link commands.IGroupBase.isCollapsed} boolean.
|
|
3081
|
+
* @i2since 1.9
|
|
3082
|
+
*/
|
|
3083
|
+
readonly type?: 'expanded' | 'collapsed' | 'stacked';
|
|
3084
|
+
/**
|
|
3085
|
+
* Gets the primary command, which is not applicable to a non-split group.
|
|
3086
|
+
*
|
|
3087
|
+
* @remarks
|
|
3088
|
+
* Use {@link commands.ICommandGroup} (`type: 'command'`) to specify a primary command.
|
|
3089
|
+
* @i2since 1.10
|
|
3090
|
+
*/
|
|
3091
|
+
readonly primaryCommand?: never;
|
|
3092
|
+
}
|
|
3093
|
+
/**
|
|
3094
|
+
* A split-button group.
|
|
3095
|
+
*
|
|
3096
|
+
* @remarks
|
|
3097
|
+
* Has a {@link commands.ICommandGroup.primaryCommand | primary command} and a drop-down menu of related
|
|
3098
|
+
* commands. In the ribbon this is displayed as a split button; in pop-up menus, as a menu entry that runs
|
|
3099
|
+
* the primary command and has a submenu.
|
|
3100
|
+
* @typeParam TCommandType - The type of the command-context for the group. Defaults to `'unscoped'`.
|
|
3101
|
+
* @i2since 1.10
|
|
3102
|
+
*/
|
|
3103
|
+
export interface ICommandGroup<TCommandType extends CommandType = 'unscoped'> extends IGroupConfigBase<TCommandType> {
|
|
3104
|
+
/**
|
|
3105
|
+
* Gets the render type, always `'command'` for a split-button group.
|
|
3106
|
+
* @i2since 1.9
|
|
3107
|
+
*/
|
|
3108
|
+
readonly type: 'command';
|
|
3109
|
+
/**
|
|
3110
|
+
* Gets the group's primary command, as a command or command identifier.
|
|
3111
|
+
*
|
|
3112
|
+
* @remarks
|
|
3113
|
+
* The primary command runs when users click the main part of the split button in the ribbon, or the
|
|
3114
|
+
* group's entry in a pop-up menu. The drop-down menu lists the commands that are surfaced in the group,
|
|
3115
|
+
* so it includes the primary command only if you also surface it there.
|
|
3116
|
+
*
|
|
3117
|
+
* If omitted, the first command that is surfaced in the group is the primary command, as in
|
|
3118
|
+
* versions before 1.10.
|
|
3119
|
+
* @i2since 1.10
|
|
3120
|
+
*/
|
|
3121
|
+
readonly primaryCommand?: ICommand | CommandId;
|
|
3122
|
+
}
|
|
3123
|
+
/**
|
|
3124
|
+
* A group of actions in either the i2 Notebook application ribbon or a popup menu.
|
|
3125
|
+
*
|
|
3126
|
+
* @remarks
|
|
3127
|
+
* Either a non-split {@link commands.IStandardGroup} (inline, collapsed, or stacked) or a split-button
|
|
3128
|
+
* {@link commands.ICommandGroup} (`type: 'command'`). The `type` discriminates between them, so
|
|
3129
|
+
* `primaryCommand` is allowed only when `type` is `'command'`. If a command group omits
|
|
3130
|
+
* `primaryCommand`, the first command that is surfaced in it is the primary command.
|
|
3131
|
+
*
|
|
3132
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its `onSurface`. Defaults to `'unscoped'`.
|
|
3133
|
+
* @i2since 1.0
|
|
3134
|
+
*/
|
|
3135
|
+
export type IGroup<TCommandType extends CommandType = 'unscoped'> = IStandardGroup<TCommandType> | ICommandGroup<TCommandType>;
|
|
2936
3136
|
/**
|
|
2937
3137
|
* A detached group of actions that you build once and surface into one or more areas.
|
|
2938
3138
|
*
|
|
@@ -2953,22 +3153,22 @@ export declare namespace commands {
|
|
|
2953
3153
|
export interface IMenuGroup extends IGroupBase {
|
|
2954
3154
|
}
|
|
2955
3155
|
/**
|
|
2956
|
-
* Configuration
|
|
3156
|
+
* Configuration shared by the {@link commands.IDynamicGroupConfig} variants.
|
|
2957
3157
|
*
|
|
2958
3158
|
* @remarks
|
|
3159
|
+
* The fields common to the collapsed {@link commands.IStandardDynamicGroup} and the split-button
|
|
3160
|
+
* {@link commands.ICommandDynamicGroup}.
|
|
2959
3161
|
* A dynamic group solves the limitation that commands can only be created during plug-in initialization.
|
|
2960
|
-
* Instead, the {@link commands.
|
|
3162
|
+
* Instead, the {@link commands.IDynamicGroupConfigBase.onPopulate} callback is called each time the group is
|
|
2961
3163
|
* opened, allowing commands to be created based on the current application state. The group's
|
|
2962
3164
|
* popup-button state (label, icon, enabled, hidden) can be driven separately by an optional
|
|
2963
|
-
* {@link commands.
|
|
3165
|
+
* {@link commands.IDynamicGroupConfigBase.onSurface} callback that runs once when the group is
|
|
2964
3166
|
* surfaced on a host.
|
|
2965
3167
|
*
|
|
2966
|
-
*
|
|
2967
|
-
*
|
|
2968
|
-
* @typeParam TCommandType - The type of the command-context for the group, which determines what payload is passed to {@link commands.IDynamicGroupConfig.onPopulate} and what event API is passed to {@link commands.IDynamicGroupConfig.onSurface}.
|
|
3168
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what payload is passed to {@link commands.IDynamicGroupConfigBase.onPopulate} and what event API is passed to {@link commands.IDynamicGroupConfigBase.onSurface}.
|
|
2969
3169
|
* @i2since 1.10
|
|
2970
3170
|
*/
|
|
2971
|
-
export interface
|
|
3171
|
+
export interface IDynamicGroupConfigBase<TCommandType extends CommandType = CommandType> {
|
|
2972
3172
|
/**
|
|
2973
3173
|
* Gets the identifier of the group. This must be a non-empty string.
|
|
2974
3174
|
*
|
|
@@ -2991,8 +3191,8 @@ export declare namespace commands {
|
|
|
2991
3191
|
* Gets the command-context type for the group.
|
|
2992
3192
|
*
|
|
2993
3193
|
* @remarks
|
|
2994
|
-
* Determines what payload is passed to {@link commands.
|
|
2995
|
-
* event API is passed to {@link commands.
|
|
3194
|
+
* Determines what payload is passed to {@link commands.IDynamicGroupConfigBase.onPopulate} and what
|
|
3195
|
+
* event API is passed to {@link commands.IDynamicGroupConfigBase.onSurface}.
|
|
2996
3196
|
* @i2since 1.10
|
|
2997
3197
|
*/
|
|
2998
3198
|
readonly context: TCommandType;
|
|
@@ -3019,7 +3219,7 @@ export declare namespace commands {
|
|
|
3019
3219
|
*
|
|
3020
3220
|
* @remarks
|
|
3021
3221
|
* The lifetime of this callback is the dynamic group's *button* — separate from the per-open
|
|
3022
|
-
* lifecycle of {@link commands.
|
|
3222
|
+
* lifecycle of {@link commands.IDynamicGroupConfigBase.onPopulate}, which populates the popup's
|
|
3023
3223
|
* contents. Use this callback to react to long-lived application state; populate the popup's
|
|
3024
3224
|
* contents in `onPopulate`.
|
|
3025
3225
|
*
|
|
@@ -3027,7 +3227,7 @@ export declare namespace commands {
|
|
|
3027
3227
|
* configuration and remains enabled.
|
|
3028
3228
|
*
|
|
3029
3229
|
* @param groupAction - The group action being surfaced.
|
|
3030
|
-
* @param eventApi - The events that the group can subscribe to, keyed by the group's `
|
|
3230
|
+
* @param eventApi - The events that the group can subscribe to, keyed by the group's `context`.
|
|
3031
3231
|
* @param signal - A signal that the application uses to tell the group that it is removing the popup button from the user interface.
|
|
3032
3232
|
*
|
|
3033
3233
|
* @returns A function that the application calls when it removes the popup button from the user interface.
|
|
@@ -3037,7 +3237,68 @@ export declare namespace commands {
|
|
|
3037
3237
|
onSurface?(groupAction: IGroupAction, eventApi: CommandEventsMap[TCommandType], signal: AbortSignal): void | (() => void);
|
|
3038
3238
|
}
|
|
3039
3239
|
/**
|
|
3040
|
-
* A
|
|
3240
|
+
* A dynamic group that renders as a collapsed dropdown/submenu, populated on open.
|
|
3241
|
+
*
|
|
3242
|
+
* @typeParam TCommandType - The type of the command-context for the group.
|
|
3243
|
+
* @i2since 1.10
|
|
3244
|
+
*/
|
|
3245
|
+
export interface IStandardDynamicGroup<TCommandType extends CommandType = CommandType> extends IDynamicGroupConfigBase<TCommandType> {
|
|
3246
|
+
/**
|
|
3247
|
+
* Gets the render type, `'collapsed'` (the default) for a dropdown/submenu.
|
|
3248
|
+
* @i2since 1.10
|
|
3249
|
+
*/
|
|
3250
|
+
readonly type?: 'collapsed';
|
|
3251
|
+
/**
|
|
3252
|
+
* Gets the primary command, which is not applicable to a collapsed dynamic group.
|
|
3253
|
+
*
|
|
3254
|
+
* @remarks
|
|
3255
|
+
* Use {@link commands.ICommandDynamicGroup} (`type: 'command'`) to specify a primary command.
|
|
3256
|
+
* @i2since 1.10
|
|
3257
|
+
*/
|
|
3258
|
+
readonly primaryCommand?: never;
|
|
3259
|
+
}
|
|
3260
|
+
/**
|
|
3261
|
+
* A dynamic split-button group.
|
|
3262
|
+
*
|
|
3263
|
+
* @remarks
|
|
3264
|
+
* Has a fixed {@link commands.ICommandDynamicGroup.primaryCommand | primary command} and a drop-down
|
|
3265
|
+
* menu that is populated each time it opens.
|
|
3266
|
+
*
|
|
3267
|
+
* @typeParam TCommandType - The type of the command-context for the group.
|
|
3268
|
+
* @i2since 1.10
|
|
3269
|
+
*/
|
|
3270
|
+
export interface ICommandDynamicGroup<TCommandType extends CommandType = CommandType> extends IDynamicGroupConfigBase<TCommandType> {
|
|
3271
|
+
/**
|
|
3272
|
+
* Gets the render type, always `'command'` for a split-button dynamic group.
|
|
3273
|
+
* @i2since 1.10
|
|
3274
|
+
*/
|
|
3275
|
+
readonly type: 'command';
|
|
3276
|
+
/**
|
|
3277
|
+
* Gets the split button's primary command, as a command or command identifier.
|
|
3278
|
+
*
|
|
3279
|
+
* @remarks
|
|
3280
|
+
* The primary command is not in the drop-down menu, which {@link commands.IDynamicGroupConfigBase.onPopulate}
|
|
3281
|
+
* populates. The split button is displayed before the group is first opened, so the primary command must
|
|
3282
|
+
* already exist: create it during plug-in initialization, not inside `onPopulate`.
|
|
3283
|
+
* @i2since 1.10
|
|
3284
|
+
*/
|
|
3285
|
+
readonly primaryCommand: ICommand | CommandId;
|
|
3286
|
+
}
|
|
3287
|
+
/**
|
|
3288
|
+
* Configuration for a dynamic group whose commands are created on demand when the group is opened.
|
|
3289
|
+
*
|
|
3290
|
+
* @remarks
|
|
3291
|
+
* A dynamic group renders as a popup, never inline: either a collapsed {@link commands.IStandardDynamicGroup}
|
|
3292
|
+
* dropdown/submenu, or a split-button {@link commands.ICommandDynamicGroup} (`type: 'command'` with a
|
|
3293
|
+
* `primaryCommand`). The `type` discriminates between them, so `primaryCommand` is required exactly when
|
|
3294
|
+
* `type` is `'command'`.
|
|
3295
|
+
*
|
|
3296
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what payload is passed to `onPopulate` and what event API is passed to `onSurface`.
|
|
3297
|
+
* @i2since 1.10
|
|
3298
|
+
*/
|
|
3299
|
+
export type IDynamicGroupConfig<TCommandType extends CommandType = CommandType> = IStandardDynamicGroup<TCommandType> | ICommandDynamicGroup<TCommandType>;
|
|
3300
|
+
/**
|
|
3301
|
+
* A scoped area for creating and surfacing commands within a {@link commands.IDynamicGroupConfigBase.onPopulate} callback.
|
|
3041
3302
|
*
|
|
3042
3303
|
* @remarks
|
|
3043
3304
|
* Methods on this interface work like their equivalents on {@link commands.IActionArea}, but are scoped to the
|
|
@@ -3075,7 +3336,7 @@ export declare namespace commands {
|
|
|
3075
3336
|
/**
|
|
3076
3337
|
* Adds a new group.
|
|
3077
3338
|
* @param group - The group configuration.
|
|
3078
|
-
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.
|
|
3339
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.IGroupConfigBase.onSurface}.
|
|
3079
3340
|
* @returns A scoped area for the contents of the new group.
|
|
3080
3341
|
* @i2since 1.10
|
|
3081
3342
|
*/
|
|
@@ -3083,7 +3344,7 @@ export declare namespace commands {
|
|
|
3083
3344
|
/**
|
|
3084
3345
|
* Adds a new group, or returns the existing one if it was already added during this `onPopulate` call.
|
|
3085
3346
|
* @param group - The group configuration.
|
|
3086
|
-
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.
|
|
3347
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.IGroupConfigBase.onSurface}.
|
|
3087
3348
|
* @returns A scoped area for the contents of the new or existing group.
|
|
3088
3349
|
* @i2since 1.10
|
|
3089
3350
|
*/
|
|
@@ -3100,7 +3361,7 @@ export declare namespace commands {
|
|
|
3100
3361
|
*
|
|
3101
3362
|
* @remarks
|
|
3102
3363
|
* Group actions mirror {@link commands.IAction} for individual commands. They are passed to
|
|
3103
|
-
* {@link commands.
|
|
3364
|
+
* {@link commands.IGroupConfigBase.onSurface} (for static groups) and {@link commands.IDynamicGroupConfigBase.onSurface}
|
|
3104
3365
|
* (for the popup button of a dynamic group), allowing the group's label, icon, and enabled/hidden
|
|
3105
3366
|
* state to be driven from application state.
|
|
3106
3367
|
*
|
|
@@ -3251,7 +3512,7 @@ export declare namespace commands {
|
|
|
3251
3512
|
* areas to avoid rebuilding the same group structure in each one.
|
|
3252
3513
|
*
|
|
3253
3514
|
* @param group - The root group to create.
|
|
3254
|
-
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.
|
|
3515
|
+
* @typeParam TCommandType - The type of the command-context for the group, which determines what event API is passed to its {@link commands.IGroupConfigBase.onSurface}.
|
|
3255
3516
|
* @returns A detached group template that you can build on and surface.
|
|
3256
3517
|
* @throws `Error` if the `group` was not valid.
|
|
3257
3518
|
* @i2since 1.10
|
|
@@ -3451,6 +3712,12 @@ export declare namespace commands {
|
|
|
3451
3712
|
* @i2since 1.3
|
|
3452
3713
|
*/
|
|
3453
3714
|
readonly exportPdf: CommandId;
|
|
3715
|
+
/**
|
|
3716
|
+
* Gets the identifier of the system command that matches the current selection against the
|
|
3717
|
+
* Information Store and unites any matching records.
|
|
3718
|
+
* @i2since 1.10
|
|
3719
|
+
*/
|
|
3720
|
+
readonly getMatches: CommandId;
|
|
3454
3721
|
/**
|
|
3455
3722
|
* Gets the identifier of the "Get paths" system command.
|
|
3456
3723
|
* @i2since 1.0
|
|
@@ -3593,9 +3860,18 @@ export declare namespace commands {
|
|
|
3593
3860
|
* @i2since 1.8
|
|
3594
3861
|
*/
|
|
3595
3862
|
readonly resetGroupLabel: CommandId;
|
|
3863
|
+
/**
|
|
3864
|
+
* Gets the identifier of the system command that renames the current chart.
|
|
3865
|
+
* @i2since 1.10
|
|
3866
|
+
*/
|
|
3867
|
+
readonly renameChart: CommandId;
|
|
3596
3868
|
/**
|
|
3597
3869
|
* Gets the identifier of the system command that saves the current chart.
|
|
3598
3870
|
* @i2since 1.1
|
|
3871
|
+
* @deprecated Deprecated since version 1.10. The system now saves charts automatically, so there is
|
|
3872
|
+
* no longer a manual save command. Use {@link commands.ISystemCommands.renameChart | renameChart}
|
|
3873
|
+
* to rename a chart, or {@link commands.ISystemCommands.shareChart | shareChart} to manage sharing
|
|
3874
|
+
* and access control.
|
|
3599
3875
|
*/
|
|
3600
3876
|
readonly saveChart: CommandId;
|
|
3601
3877
|
/**
|
|
@@ -3620,6 +3896,11 @@ export declare namespace commands {
|
|
|
3620
3896
|
* @i2since 1.8
|
|
3621
3897
|
*/
|
|
3622
3898
|
readonly selectUnitedItems: CommandId;
|
|
3899
|
+
/**
|
|
3900
|
+
* Gets the identifier of the system command that manages sharing and access control for the current chart.
|
|
3901
|
+
* @i2since 1.10
|
|
3902
|
+
*/
|
|
3903
|
+
readonly shareChart: CommandId;
|
|
3623
3904
|
/**
|
|
3624
3905
|
* Gets the identifier of the system command that allows users to share records with each other.
|
|
3625
3906
|
* @i2since 1.3
|
|
@@ -3645,6 +3926,11 @@ export declare namespace commands {
|
|
|
3645
3926
|
* @i2since 1.0
|
|
3646
3927
|
*/
|
|
3647
3928
|
readonly toggleExternalSearches: CommandId;
|
|
3929
|
+
/**
|
|
3930
|
+
* Gets the identifier of the system command that toggles the Find Connecting Networks UI.
|
|
3931
|
+
* @i2since 1.10
|
|
3932
|
+
*/
|
|
3933
|
+
readonly toggleFindConnectingNetworks: CommandId;
|
|
3648
3934
|
/**
|
|
3649
3935
|
* Gets the identifier of the system command that toggles the lists UI.
|
|
3650
3936
|
* @i2since 1.3
|
|
@@ -3675,6 +3961,11 @@ export declare namespace commands {
|
|
|
3675
3961
|
* @i2since 1.0
|
|
3676
3962
|
*/
|
|
3677
3963
|
readonly toggleRecordInspector: CommandId;
|
|
3964
|
+
/**
|
|
3965
|
+
* Gets the identifier of the system command that toggles the Social Network Analysis UI.
|
|
3966
|
+
* @i2since 1.10
|
|
3967
|
+
*/
|
|
3968
|
+
readonly toggleSocialNetworkAnalysis: CommandId;
|
|
3678
3969
|
/**
|
|
3679
3970
|
* Gets the identifier of the system command that toggles the style UI.
|
|
3680
3971
|
* @i2since 1.2
|
|
@@ -4751,9 +5042,63 @@ export declare namespace data {
|
|
|
4751
5042
|
export declare namespace dialog {
|
|
4752
5043
|
/**
|
|
4753
5044
|
* A size for a dialog window.
|
|
5045
|
+
*
|
|
5046
|
+
* @remarks
|
|
5047
|
+
* The `'xmedium'` size requires version 1.10 or later.
|
|
4754
5048
|
* @i2since 1.4
|
|
4755
5049
|
*/
|
|
4756
|
-
export type DialogSize = 'small' | 'medium' | 'large';
|
|
5050
|
+
export type DialogSize = 'small' | 'medium' | 'xmedium' | 'large';
|
|
5051
|
+
/**
|
|
5052
|
+
* Explicit dimensions for a dialog window, as CSS length strings.
|
|
5053
|
+
*
|
|
5054
|
+
* @remarks
|
|
5055
|
+
* Both axes are required. Each axis is independent and is clamped to the `'large'` size
|
|
5056
|
+
* (approximately the size of the viewport): a larger value is reduced to it. To size the dialog's
|
|
5057
|
+
* height to fit its content, use {@link dialog.IDialogAutoHeightSize} instead.
|
|
5058
|
+
*
|
|
5059
|
+
* Each value must be an unsigned number followed by one of the units `px`, `rem`, `em`, `vh`,
|
|
5060
|
+
* `vw`, or `%` (for example, `'600px'`, `'40rem'`, or `'75%'`).
|
|
5061
|
+
* @i2since 1.10
|
|
5062
|
+
*/
|
|
5063
|
+
export interface IDialogDimensions {
|
|
5064
|
+
/**
|
|
5065
|
+
* Gets the width of the dialog. Clamped to the `'large'` size.
|
|
5066
|
+
* @i2since 1.10
|
|
5067
|
+
*/
|
|
5068
|
+
readonly width: string;
|
|
5069
|
+
/**
|
|
5070
|
+
* Gets the height of the dialog. Clamped to the `'large'` size.
|
|
5071
|
+
* @i2since 1.10
|
|
5072
|
+
*/
|
|
5073
|
+
readonly height: string;
|
|
5074
|
+
}
|
|
5075
|
+
/**
|
|
5076
|
+
* A size for a dialog window that has a preset width and a height that fits its content.
|
|
5077
|
+
*
|
|
5078
|
+
* @remarks
|
|
5079
|
+
* The dialog's height follows the height of the content that it hosts, and changes as the content
|
|
5080
|
+
* changes. The height is at least a small minimum, and at most the `'large'` size (approximately
|
|
5081
|
+
* the size of the viewport); content that is taller than that scrolls.
|
|
5082
|
+
*
|
|
5083
|
+
* Either the dialog determines the size of the content, as with a preset or explicit dimensions,
|
|
5084
|
+
* or the content determines the size of the dialog, as it does here. The content must therefore
|
|
5085
|
+
* determine its own height. Content whose height depends on the height of the dialog, such as a
|
|
5086
|
+
* root element with `height: 100%` or a height in `vh` units, keeps the dialog at its current
|
|
5087
|
+
* height.
|
|
5088
|
+
* @i2since 1.10
|
|
5089
|
+
*/
|
|
5090
|
+
export interface IDialogAutoHeightSize {
|
|
5091
|
+
/**
|
|
5092
|
+
* Gets the preset that sets the width of the dialog.
|
|
5093
|
+
* @i2since 1.10
|
|
5094
|
+
*/
|
|
5095
|
+
readonly width: DialogSize;
|
|
5096
|
+
/**
|
|
5097
|
+
* Gets the value that makes the height of the dialog fit its content.
|
|
5098
|
+
* @i2since 1.10
|
|
5099
|
+
*/
|
|
5100
|
+
readonly height: 'auto';
|
|
5101
|
+
}
|
|
4757
5102
|
/**
|
|
4758
5103
|
* An identifier of a dialog action.
|
|
4759
5104
|
* @i2since 1.4
|
|
@@ -4807,10 +5152,15 @@ export declare namespace dialog {
|
|
|
4807
5152
|
*/
|
|
4808
5153
|
readonly path: string;
|
|
4809
5154
|
/**
|
|
4810
|
-
* Gets the size of the dialog
|
|
5155
|
+
* Gets the size of the dialog, as a named preset, as a preset width with a height that fits the
|
|
5156
|
+
* content, or as explicit dimensions.
|
|
5157
|
+
*
|
|
5158
|
+
* @remarks
|
|
5159
|
+
* The `'xmedium'` preset, {@link dialog.IDialogAutoHeightSize | auto-height sizes}, and explicit
|
|
5160
|
+
* {@link dialog.IDialogDimensions | dimensions} require version 1.10 or later.
|
|
4811
5161
|
* @i2since 1.4
|
|
4812
5162
|
*/
|
|
4813
|
-
readonly size: DialogSize;
|
|
5163
|
+
readonly size: DialogSize | IDialogAutoHeightSize | IDialogDimensions;
|
|
4814
5164
|
/**
|
|
4815
5165
|
* Gets the data for populating the dialog when it's first displayed.
|
|
4816
5166
|
*
|
|
@@ -5161,7 +5511,7 @@ export declare interface NotebookStatic {
|
|
|
5161
5511
|
* @public
|
|
5162
5512
|
* @i2since 1.0
|
|
5163
5513
|
*/
|
|
5164
|
-
getEntryPointApi(pluginId: string, apiVersion: '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5' | '1.6' | '1.7' | '1.8' | '1.9'): Promise<IEntryPointApi>;
|
|
5514
|
+
getEntryPointApi(pluginId: string, apiVersion: '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5' | '1.6' | '1.7' | '1.8' | '1.9' | '1.10' | '1.11'): Promise<IEntryPointApi>;
|
|
5165
5515
|
}
|
|
5166
5516
|
|
|
5167
5517
|
/**
|
|
@@ -5466,6 +5816,25 @@ export declare namespace schema {
|
|
|
5466
5816
|
* @i2since 1.0
|
|
5467
5817
|
*/
|
|
5468
5818
|
readonly itemTypes: data.IKeyedReadOnlyCollection<ChartItemTypeIdentifier, IChartItemType>;
|
|
5819
|
+
/**
|
|
5820
|
+
* Gets all the core entity types in the chart schema.
|
|
5821
|
+
*
|
|
5822
|
+
* @remarks
|
|
5823
|
+
* A core entity type is the base concept, such as "Person", that entity types are based on. To
|
|
5824
|
+
* get the core entity type that an entity type is based on, use
|
|
5825
|
+
* {@link schema.IChartEntityType.coreType}.
|
|
5826
|
+
* @i2since 1.11
|
|
5827
|
+
*/
|
|
5828
|
+
readonly coreEntityTypes: data.IKeyedReadOnlyCollection<ChartItemTypeIdentifier, IChartCoreEntityType>;
|
|
5829
|
+
/**
|
|
5830
|
+
* Gets all the core link types in the chart schema.
|
|
5831
|
+
*
|
|
5832
|
+
* @remarks
|
|
5833
|
+
* A core link type is the base concept that link types are based on. To get the core link type
|
|
5834
|
+
* that a link type is based on, use {@link schema.IChartLinkType.coreType}.
|
|
5835
|
+
* @i2since 1.11
|
|
5836
|
+
*/
|
|
5837
|
+
readonly coreLinkTypes: data.IKeyedReadOnlyCollection<ChartItemTypeIdentifier, IChartCoreLinkType>;
|
|
5469
5838
|
/**
|
|
5470
5839
|
* Gets the item type in the chart schema that has the specified i2 Analyze type identifier.
|
|
5471
5840
|
* @param analyzeItemTypeId - An i2 Analyze item type identifier.
|
|
@@ -5591,6 +5960,16 @@ export declare namespace schema {
|
|
|
5591
5960
|
* @i2since 1.0
|
|
5592
5961
|
*/
|
|
5593
5962
|
readonly image: data.IImage;
|
|
5963
|
+
/**
|
|
5964
|
+
* Gets the core entity type that the entity type is based on, if it has one.
|
|
5965
|
+
*
|
|
5966
|
+
* @remarks
|
|
5967
|
+
* The value is absent when the entity type is not based on a core entity type. For example,
|
|
5968
|
+
* custom entity types and entity types from a schema that predates core types have no core
|
|
5969
|
+
* entity type.
|
|
5970
|
+
* @i2since 1.11
|
|
5971
|
+
*/
|
|
5972
|
+
readonly coreType?: IChartCoreEntityType;
|
|
5594
5973
|
}
|
|
5595
5974
|
/**
|
|
5596
5975
|
* A link type.
|
|
@@ -5607,7 +5986,131 @@ export declare namespace schema {
|
|
|
5607
5986
|
* @i2since 1.5
|
|
5608
5987
|
*/
|
|
5609
5988
|
toEntityTypes: data.IReadOnlyCollection<IChartEntityType>;
|
|
5989
|
+
/**
|
|
5990
|
+
* Gets the core link type that the link type is based on, if it has one.
|
|
5991
|
+
*
|
|
5992
|
+
* @remarks
|
|
5993
|
+
* The value is absent when the link type is not based on a core link type. For example, custom
|
|
5994
|
+
* link types and link types from a schema that predates core types have no core link type.
|
|
5995
|
+
* @i2since 1.11
|
|
5996
|
+
*/
|
|
5997
|
+
readonly coreType?: IChartCoreLinkType;
|
|
5998
|
+
}
|
|
5999
|
+
/**
|
|
6000
|
+
* The governance tier of a type, which controls who can create and modify its definition.
|
|
6001
|
+
*
|
|
6002
|
+
* @remarks
|
|
6003
|
+
* The following list shows the tiers, from most to least restricted:
|
|
6004
|
+
*
|
|
6005
|
+
* - `i2Ontology`: i2 Group curates the type and locks its structure, identifiers, and semantics.
|
|
6006
|
+
* - `systemGoverned`: Schema administrators can modify the type through the schema authoring path.
|
|
6007
|
+
* - `analystGoverned`: Analysts create and modify the type, which is based on an existing core type.
|
|
6008
|
+
* @i2since 1.11
|
|
6009
|
+
*/
|
|
6010
|
+
export type GovernanceTier = 'i2Ontology' | 'systemGoverned' | 'analystGoverned';
|
|
6011
|
+
/**
|
|
6012
|
+
* A set of information that is common to all core types in a chart schema.
|
|
6013
|
+
*
|
|
6014
|
+
* @remarks
|
|
6015
|
+
* A core type is the base concept that item types are based on. For example, the "Suspect" and
|
|
6016
|
+
* "Witness" entity types can both be based on a "Person" core entity type. Because item types
|
|
6017
|
+
* that share a core type represent the same concept, you can treat their records together. Some
|
|
6018
|
+
* core types have no item types based on them.
|
|
6019
|
+
* @i2since 1.11
|
|
6020
|
+
*/
|
|
6021
|
+
export interface IChartCoreItemTypeBase {
|
|
6022
|
+
/**
|
|
6023
|
+
* Gets the identifier of the core type.
|
|
6024
|
+
* @i2since 1.11
|
|
6025
|
+
*/
|
|
6026
|
+
readonly id: ChartItemTypeId;
|
|
6027
|
+
/**
|
|
6028
|
+
* Gets the identifier of the core type in the i2 Analyze schema.
|
|
6029
|
+
* @i2since 1.11
|
|
6030
|
+
*/
|
|
6031
|
+
readonly analyzeId: AnalyzeItemTypeId;
|
|
6032
|
+
/**
|
|
6033
|
+
* Gets the display name of the core type.
|
|
6034
|
+
* @i2since 1.11
|
|
6035
|
+
*/
|
|
6036
|
+
readonly displayName: string;
|
|
6037
|
+
/**
|
|
6038
|
+
* Gets the description of the core type.
|
|
6039
|
+
* @i2since 1.11
|
|
6040
|
+
*/
|
|
6041
|
+
readonly description: string;
|
|
6042
|
+
/**
|
|
6043
|
+
* Gets the identifier of the semantic type of the core type.
|
|
6044
|
+
* @i2since 1.11
|
|
6045
|
+
*/
|
|
6046
|
+
readonly semanticTypeId: string;
|
|
6047
|
+
/**
|
|
6048
|
+
* Gets all the property types of the core type.
|
|
6049
|
+
*
|
|
6050
|
+
* @remarks
|
|
6051
|
+
* The property types are in the order that the core type declares them, which is the order in
|
|
6052
|
+
* which to present properties.
|
|
6053
|
+
* @i2since 1.11
|
|
6054
|
+
*/
|
|
6055
|
+
readonly propertyTypes: data.IKeyedReadOnlyCollection<PropertyTypeIdentifier, IChartCorePropertyType>;
|
|
6056
|
+
/**
|
|
6057
|
+
* Gets the property type that has the specified i2 Analyze identifier.
|
|
6058
|
+
*
|
|
6059
|
+
* @remarks
|
|
6060
|
+
* If the core type contains more than one property type with the identifier, such as after the
|
|
6061
|
+
* logical type of the property changes, the method returns the one that is not orphaned.
|
|
6062
|
+
* @param analyzePropertyTypeId - An i2 Analyze property type identifier.
|
|
6063
|
+
* @returns The requested property type.
|
|
6064
|
+
* @throws `VerbatimError` if the core type does not contain a property type that has the specified
|
|
6065
|
+
* i2 Analyze identifier, or if it contains more than one and all of them are orphaned.
|
|
6066
|
+
* @i2since 1.11
|
|
6067
|
+
*/
|
|
6068
|
+
getPropertyType(analyzePropertyTypeId: AnalyzePropertyTypeId): IChartCorePropertyType;
|
|
6069
|
+
/**
|
|
6070
|
+
* Indicates whether the core type is orphaned. An orphaned core type does not have a counterpart
|
|
6071
|
+
* in the i2 Analyze schema.
|
|
6072
|
+
* @i2since 1.11
|
|
6073
|
+
*/
|
|
6074
|
+
readonly isOrphaned: boolean;
|
|
6075
|
+
/**
|
|
6076
|
+
* Tests whether the core type is a core entity type. This method functions as a TypeScript
|
|
6077
|
+
* typeguard.
|
|
6078
|
+
*
|
|
6079
|
+
* @returns `true` if the core type is a core entity type, or `false` otherwise.
|
|
6080
|
+
* @i2since 1.11
|
|
6081
|
+
*/
|
|
6082
|
+
isEntityType(): this is IChartCoreEntityType;
|
|
6083
|
+
/**
|
|
6084
|
+
* Tests whether the core type is a core link type. This method functions as a TypeScript
|
|
6085
|
+
* typeguard.
|
|
6086
|
+
*
|
|
6087
|
+
* @returns `true` if the core type is a core link type, or `false` otherwise.
|
|
6088
|
+
* @i2since 1.11
|
|
6089
|
+
*/
|
|
6090
|
+
isLinkType(): this is IChartCoreLinkType;
|
|
6091
|
+
}
|
|
6092
|
+
/**
|
|
6093
|
+
* A core entity type.
|
|
6094
|
+
* @i2since 1.11
|
|
6095
|
+
*/
|
|
6096
|
+
export interface IChartCoreEntityType extends IChartCoreItemTypeBase {
|
|
6097
|
+
/**
|
|
6098
|
+
* Gets the image that represents the core entity type.
|
|
6099
|
+
* @i2since 1.11
|
|
6100
|
+
*/
|
|
6101
|
+
readonly image: data.IImage;
|
|
6102
|
+
}
|
|
6103
|
+
/**
|
|
6104
|
+
* A core link type.
|
|
6105
|
+
* @i2since 1.11
|
|
6106
|
+
*/
|
|
6107
|
+
export interface IChartCoreLinkType extends IChartCoreItemTypeBase {
|
|
5610
6108
|
}
|
|
6109
|
+
/**
|
|
6110
|
+
* A core entity type or a core link type.
|
|
6111
|
+
* @i2since 1.11
|
|
6112
|
+
*/
|
|
6113
|
+
export type IChartCoreItemType = IChartCoreEntityType | IChartCoreLinkType;
|
|
5611
6114
|
/**
|
|
5612
6115
|
* A part of a label that consists of a literal string.
|
|
5613
6116
|
* @i2since 1.0
|
|
@@ -5757,6 +6260,35 @@ export declare namespace schema {
|
|
|
5757
6260
|
* @i2since 1.5
|
|
5758
6261
|
*/
|
|
5759
6262
|
readonly origin: ISchemaInfo;
|
|
6263
|
+
/**
|
|
6264
|
+
* Gets the core type that the item type is based on, if it has one.
|
|
6265
|
+
*
|
|
6266
|
+
* @remarks
|
|
6267
|
+
* The core type is the base concept, such as "Person", that the item type is based on. Because
|
|
6268
|
+
* item types that share a core type represent the same concept, you can treat their records
|
|
6269
|
+
* together. The value is absent when the item type is not based on a core type. For example,
|
|
6270
|
+
* custom item types and item types from a schema that predates core types have no core type.
|
|
6271
|
+
* @i2since 1.11
|
|
6272
|
+
*/
|
|
6273
|
+
readonly coreType?: IChartCoreItemType;
|
|
6274
|
+
/**
|
|
6275
|
+
* Indicates whether the item type is the default item type for its core type.
|
|
6276
|
+
*
|
|
6277
|
+
* @remarks
|
|
6278
|
+
* A core type has at most one default item type, which is used for a record of the core type
|
|
6279
|
+
* when no other item type is specified. The value is `false` for an item type that has no core
|
|
6280
|
+
* type.
|
|
6281
|
+
* @i2since 1.11
|
|
6282
|
+
*/
|
|
6283
|
+
readonly isDefault: boolean;
|
|
6284
|
+
/**
|
|
6285
|
+
* Gets the governance tier of the item type, which controls who can create and modify it.
|
|
6286
|
+
*
|
|
6287
|
+
* @remarks
|
|
6288
|
+
* The value is absent if the governance tier is not one that this version of the API recognizes.
|
|
6289
|
+
* @i2since 1.11
|
|
6290
|
+
*/
|
|
6291
|
+
readonly governanceTier?: GovernanceTier;
|
|
5760
6292
|
}
|
|
5761
6293
|
/**
|
|
5762
6294
|
* Information about a schema in an i2 Analyze deployment.
|
|
@@ -5999,10 +6531,10 @@ export declare namespace schema {
|
|
|
5999
6531
|
*/
|
|
6000
6532
|
export type PropertyTypeSpecifier = PropertyTypeIdentifier | IChartPropertyType;
|
|
6001
6533
|
/**
|
|
6002
|
-
* A property
|
|
6003
|
-
* @i2since 1.
|
|
6534
|
+
* A set of information that is common to all property types in a chart schema.
|
|
6535
|
+
* @i2since 1.11
|
|
6004
6536
|
*/
|
|
6005
|
-
export interface
|
|
6537
|
+
export interface IChartPropertyTypeBase {
|
|
6006
6538
|
/**
|
|
6007
6539
|
* Gets the identifier of the property type.
|
|
6008
6540
|
* @i2since 1.0
|
|
@@ -6028,11 +6560,6 @@ export declare namespace schema {
|
|
|
6028
6560
|
* @i2since 1.0
|
|
6029
6561
|
*/
|
|
6030
6562
|
readonly semanticTypeId: string;
|
|
6031
|
-
/**
|
|
6032
|
-
* Indicates whether records whose item type contains the property type must have a value for it.
|
|
6033
|
-
* @i2since 1.0
|
|
6034
|
-
*/
|
|
6035
|
-
readonly isMandatory: boolean;
|
|
6036
6563
|
/**
|
|
6037
6564
|
* Gets the logical type of the value of a property that has the property type.
|
|
6038
6565
|
* @i2since 1.0
|
|
@@ -6067,6 +6594,33 @@ export declare namespace schema {
|
|
|
6067
6594
|
*/
|
|
6068
6595
|
readonly possibleValues?: data.IReadOnlyCollection<IPossibleValue>;
|
|
6069
6596
|
}
|
|
6597
|
+
/**
|
|
6598
|
+
* A property type of an item type.
|
|
6599
|
+
* @i2since 1.0
|
|
6600
|
+
*/
|
|
6601
|
+
export interface IChartPropertyType extends IChartPropertyTypeBase {
|
|
6602
|
+
/**
|
|
6603
|
+
* Gets the item type that the property type belongs to.
|
|
6604
|
+
* @i2since 1.10
|
|
6605
|
+
*/
|
|
6606
|
+
readonly itemType: IChartItemType;
|
|
6607
|
+
/**
|
|
6608
|
+
* Indicates whether records whose item type contains the property type must have a value for it.
|
|
6609
|
+
* @i2since 1.0
|
|
6610
|
+
*/
|
|
6611
|
+
readonly isMandatory: boolean;
|
|
6612
|
+
}
|
|
6613
|
+
/**
|
|
6614
|
+
* A property type of a core type.
|
|
6615
|
+
*
|
|
6616
|
+
* @remarks
|
|
6617
|
+
* A core property type defines a property once for its core type. Unlike an
|
|
6618
|
+
* {@link schema.IChartPropertyType}, it does not belong to a particular item type. To get the
|
|
6619
|
+
* property values of a record, use the property types of the record's item type.
|
|
6620
|
+
* @i2since 1.11
|
|
6621
|
+
*/
|
|
6622
|
+
export interface IChartCorePropertyType extends IChartPropertyTypeBase {
|
|
6623
|
+
}
|
|
6070
6624
|
/**
|
|
6071
6625
|
* A possible value for a property whose property type has a string-based logical type.
|
|
6072
6626
|
* @i2since 1.0
|
|
@@ -6781,7 +7335,7 @@ export declare namespace visual {
|
|
|
6781
7335
|
}
|
|
6782
7336
|
/**
|
|
6783
7337
|
* A value for a setting that affects the appearance of an element.
|
|
6784
|
-
* @typeParam T - The
|
|
7338
|
+
* @typeParam T - The type of the value.
|
|
6785
7339
|
* @i2since 1.2
|
|
6786
7340
|
*/
|
|
6787
7341
|
export interface IElementSetting<T> {
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i2analyze/notebook-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0-dev.0",
|
|
4
4
|
"description": "i2 Notebook SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,35 +12,37 @@
|
|
|
12
12
|
"url": "https://i2group.github.io/notebook-sdk/"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@ibmi2/
|
|
16
|
-
"@
|
|
17
|
-
"@microsoft/api-
|
|
18
|
-
"@microsoft/api-extractor": "7.33.8",
|
|
15
|
+
"@ibmi2/webui-lerna-build-scripts": "^6.0.2",
|
|
16
|
+
"@microsoft/api-documenter": "^7.26.0",
|
|
17
|
+
"@microsoft/api-extractor": "^7.58.11",
|
|
19
18
|
"concurrently": "^7.3.0",
|
|
20
19
|
"copyfiles": "^2.4.1",
|
|
21
20
|
"rimraf": "^3.0.0",
|
|
22
|
-
"typescript": "^
|
|
21
|
+
"typescript": "^6.0.3",
|
|
22
|
+
"@i2internal/eslint-plugin": "^11.5.0"
|
|
23
23
|
},
|
|
24
24
|
"sideEffects": [
|
|
25
25
|
"**/*.spec.*"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
28
|
"compile": "concurrently \"npm:compile:*\"",
|
|
29
|
-
"compile:typescript-es": "
|
|
30
|
-
"compile:copy-es": "
|
|
31
|
-
"compile:eslint": "
|
|
29
|
+
"compile:typescript-es": "tsc -p tsconfig-tsc.json --module esnext --outDir dist/es",
|
|
30
|
+
"compile:copy-es": "copyfiles -u 1 \"src/**/*.d.ts\" dist/es",
|
|
31
|
+
"compile:eslint": "eslint src --no-error-on-unmatched-pattern --max-warnings 0",
|
|
32
32
|
"postcompile": "node scripts/run-api-extractor.js",
|
|
33
33
|
"api-extractor:dev": "api-extractor run --local --verbose --config scripts/api-extractor.json",
|
|
34
34
|
"api-extractor:ci": "api-extractor run --verbose --config scripts/api-extractor.json",
|
|
35
35
|
"build": "npm run compile",
|
|
36
|
-
"clean": "rimraf bld dist doc/obj",
|
|
37
|
-
"prepare": "copyfiles --flat dist/es/index.js lib/"
|
|
36
|
+
"clean": "rimraf bld dist doc/obj AGENTS.md",
|
|
37
|
+
"prepare": "copyfiles --flat dist/es/index.js lib/",
|
|
38
|
+
"prepack": "node scripts/copy-agents-md.js"
|
|
38
39
|
},
|
|
39
40
|
"files": [
|
|
40
41
|
"lib/index.js",
|
|
41
42
|
"lib/index.d.ts",
|
|
42
43
|
"lib/gen/notebook-sdk-public.d.ts",
|
|
43
|
-
"lib/tsdoc-metadata.json"
|
|
44
|
+
"lib/tsdoc-metadata.json",
|
|
45
|
+
"AGENTS.md"
|
|
44
46
|
],
|
|
45
47
|
"main": "",
|
|
46
48
|
"module": "lib/index.js",
|
|
@@ -49,6 +51,6 @@
|
|
|
49
51
|
"extends": "../../package.json"
|
|
50
52
|
},
|
|
51
53
|
"engines": {
|
|
52
|
-
"node": ">=
|
|
54
|
+
"node": ">=20.19.0"
|
|
53
55
|
}
|
|
54
56
|
}
|