@twip/web 0.0.0 → 0.1.0-alpha.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/LICENSE +202 -0
- package/dist/AccessibleNode.d.ts +51 -0
- package/dist/AccessibleNode.mjs +177 -0
- package/dist/Alignment.d.ts +38 -0
- package/dist/Alignment.mjs +90 -0
- package/dist/BorderEdges.d.ts +50 -0
- package/dist/BorderEdges.mjs +114 -0
- package/dist/BorderStyle.d.ts +27 -0
- package/dist/BorderStyle.mjs +81 -0
- package/dist/Bytes.d.ts +19 -0
- package/dist/Bytes.mjs +76 -0
- package/dist/CaretPosition.d.ts +34 -0
- package/dist/CaretPosition.mjs +148 -0
- package/dist/CellAlignment.d.ts +25 -0
- package/dist/CellAlignment.mjs +75 -0
- package/dist/CellShift.d.ts +30 -0
- package/dist/CellShift.mjs +78 -0
- package/dist/Clipboard.d.ts +22 -0
- package/dist/Clipboard.mjs +90 -0
- package/dist/ColumnSide.d.ts +24 -0
- package/dist/ColumnSide.mjs +72 -0
- package/dist/ControlKind.d.ts +28 -0
- package/dist/ControlKind.mjs +84 -0
- package/dist/ControlLock.d.ts +42 -0
- package/dist/ControlLock.mjs +96 -0
- package/dist/DocumentStatus.d.ts +34 -0
- package/dist/DocumentStatus.mjs +148 -0
- package/dist/Editor.d.ts +773 -0
- package/dist/Editor.mjs +2269 -0
- package/dist/EditorMode.d.ts +34 -0
- package/dist/EditorMode.mjs +84 -0
- package/dist/Element.d.ts +57 -0
- package/dist/Element.mjs +201 -0
- package/dist/ElementKind.d.ts +28 -0
- package/dist/ElementKind.mjs +78 -0
- package/dist/ElementList.d.ts +20 -0
- package/dist/ElementList.mjs +71 -0
- package/dist/ElementText.d.ts +34 -0
- package/dist/ElementText.mjs +84 -0
- package/dist/Event.d.ts +45 -0
- package/dist/Event.mjs +159 -0
- package/dist/EventKind.d.ts +39 -0
- package/dist/EventKind.mjs +93 -0
- package/dist/EventList.d.ts +20 -0
- package/dist/EventList.mjs +71 -0
- package/dist/Fonts.d.ts +29 -0
- package/dist/Fonts.mjs +107 -0
- package/dist/Highlight.d.ts +41 -0
- package/dist/Highlight.mjs +117 -0
- package/dist/MarginPreset.d.ts +38 -0
- package/dist/MarginPreset.mjs +90 -0
- package/dist/MarkSeverity.d.ts +25 -0
- package/dist/MarkSeverity.mjs +75 -0
- package/dist/Modifiers.d.ts +34 -0
- package/dist/Modifiers.mjs +148 -0
- package/dist/OpenError.d.ts +30 -0
- package/dist/OpenError.mjs +78 -0
- package/dist/Orientation.d.ts +30 -0
- package/dist/Orientation.mjs +78 -0
- package/dist/PageNumber.d.ts +34 -0
- package/dist/PageNumber.mjs +84 -0
- package/dist/PaperSize.d.ts +50 -0
- package/dist/PaperSize.mjs +108 -0
- package/dist/ParagraphBorders.d.ts +34 -0
- package/dist/ParagraphBorders.mjs +84 -0
- package/dist/PictureWrap.d.ts +34 -0
- package/dist/PictureWrap.mjs +90 -0
- package/dist/PointerKind.d.ts +23 -0
- package/dist/PointerKind.mjs +75 -0
- package/dist/Rect.d.ts +34 -0
- package/dist/Rect.mjs +148 -0
- package/dist/Request.d.ts +55 -0
- package/dist/Request.mjs +207 -0
- package/dist/RequestKind.d.ts +45 -0
- package/dist/RequestKind.mjs +105 -0
- package/dist/RequestList.d.ts +20 -0
- package/dist/RequestList.mjs +71 -0
- package/dist/RowHeightRule.d.ts +34 -0
- package/dist/RowHeightRule.mjs +84 -0
- package/dist/RowSide.d.ts +24 -0
- package/dist/RowSide.mjs +72 -0
- package/dist/SaveError.d.ts +24 -0
- package/dist/SaveError.mjs +72 -0
- package/dist/SelectionInfo.d.ts +39 -0
- package/dist/SelectionInfo.mjs +166 -0
- package/dist/SelectionKind.d.ts +37 -0
- package/dist/SelectionKind.mjs +93 -0
- package/dist/THIRD-PARTY-NOTICES.md +4475 -0
- package/dist/TableAlignment.d.ts +25 -0
- package/dist/TableAlignment.mjs +75 -0
- package/dist/TableSelection.d.ts +38 -0
- package/dist/TableSelection.mjs +90 -0
- package/dist/TableWidthUnit.d.ts +31 -0
- package/dist/TableWidthUnit.mjs +81 -0
- package/dist/TextUnit.d.ts +25 -0
- package/dist/TextUnit.mjs +75 -0
- package/dist/diplomat-runtime.d.ts +15 -0
- package/dist/diplomat-runtime.mjs +786 -0
- package/dist/diplomat-wasm.mjs +18 -0
- package/dist/gpu.d.ts +15 -0
- package/dist/gpu.mjs +42 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.mjs +101 -0
- package/dist/twip-wasm.js +2 -0
- package/dist/twip_wasm.wasm +0 -0
- package/package.json +18 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Which way the remaining cells move when cells are deleted.
|
|
9
|
+
*/
|
|
10
|
+
export class CellShift {
|
|
11
|
+
#value = undefined;
|
|
12
|
+
|
|
13
|
+
static #values = new Map([
|
|
14
|
+
["Left", 0],
|
|
15
|
+
["Up", 1]
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
static getAllEntries() {
|
|
19
|
+
return CellShift.#values.entries();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#internalConstructor(value) {
|
|
23
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
24
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
25
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
26
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
27
|
+
this.#value = arguments[2];
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
return CellShift.#objectValues[arguments[1]];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (value instanceof CellShift) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let intVal = CellShift.#values.get(value);
|
|
38
|
+
|
|
39
|
+
// Nullish check, checks for null or undefined
|
|
40
|
+
if (intVal != null) {
|
|
41
|
+
return CellShift.#objectValues[intVal];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
throw TypeError(value + " is not a CellShift and does not correspond to any of its enumerator values.");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
static fromValue(value) {
|
|
49
|
+
return new CellShift(value);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get value(){
|
|
53
|
+
return [...CellShift.#values.keys()][this.#value];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
get ffiValue(){
|
|
58
|
+
return this.#value;
|
|
59
|
+
}
|
|
60
|
+
static #objectValues = [
|
|
61
|
+
new CellShift(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
|
|
62
|
+
new CellShift(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The cells to the right move left.
|
|
67
|
+
*/
|
|
68
|
+
static Left = CellShift.#objectValues[0];
|
|
69
|
+
/**
|
|
70
|
+
* The cells below move up.
|
|
71
|
+
*/
|
|
72
|
+
static Up = CellShift.#objectValues[1];
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
constructor(value) {
|
|
76
|
+
return this.#internalConstructor(...arguments)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A copied or cut selection: plain text and HTML for other applications, and a token that pastes the exact
|
|
8
|
+
* content back into any Twip editor of this process.
|
|
9
|
+
*/
|
|
10
|
+
export class Clipboard {
|
|
11
|
+
/** @internal */
|
|
12
|
+
get ffiValue(): pointer;
|
|
13
|
+
/** @internal */
|
|
14
|
+
constructor();
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
text(): string;
|
|
18
|
+
|
|
19
|
+
html(): string;
|
|
20
|
+
|
|
21
|
+
token(): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
const Clipboard_box_destroy_registry = new FinalizationRegistry((ptr) => {
|
|
6
|
+
wasm.Clipboard_destroy(ptr);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A copied or cut selection: plain text and HTML for other applications, and a token that pastes the exact
|
|
11
|
+
* content back into any Twip editor of this process.
|
|
12
|
+
*/
|
|
13
|
+
export class Clipboard {
|
|
14
|
+
// Internal ptr reference:
|
|
15
|
+
#ptr = null;
|
|
16
|
+
|
|
17
|
+
// Lifetimes are only to keep dependencies alive.
|
|
18
|
+
// Since JS won't garbage collect until there are no incoming edges.
|
|
19
|
+
#selfEdge = [];
|
|
20
|
+
|
|
21
|
+
#internalConstructor(symbol, ptr, selfEdge) {
|
|
22
|
+
if (symbol !== diplomatRuntime.internalConstructor) {
|
|
23
|
+
console.error("Clipboard is an Opaque type. You cannot call its constructor.");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.#ptr = ptr;
|
|
27
|
+
this.#selfEdge = selfEdge;
|
|
28
|
+
|
|
29
|
+
// Are we being borrowed? If not, we can register.
|
|
30
|
+
if (this.#selfEdge.length === 0) {
|
|
31
|
+
Clipboard_box_destroy_registry.register(this, this.#ptr);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
get ffiValue() {
|
|
38
|
+
return this.#ptr;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
text() {
|
|
43
|
+
const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
|
|
44
|
+
|
|
45
|
+
wasm.Clipboard_text(this.ffiValue, write.buffer);
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
return write.readString8();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
finally {
|
|
52
|
+
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
53
|
+
write.free();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
html() {
|
|
58
|
+
const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
|
|
59
|
+
|
|
60
|
+
wasm.Clipboard_html(this.ffiValue, write.buffer);
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
return write.readString8();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
finally {
|
|
67
|
+
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
68
|
+
write.free();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
token() {
|
|
73
|
+
const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
|
|
74
|
+
|
|
75
|
+
wasm.Clipboard_token(this.ffiValue, write.buffer);
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
return write.readString8();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
finally {
|
|
82
|
+
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
83
|
+
write.free();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
constructor(symbol, ptr, selfEdge) {
|
|
88
|
+
return this.#internalConstructor(...arguments)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a new column goes relative to the selected columns.
|
|
8
|
+
*/
|
|
9
|
+
export class ColumnSide {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: ColumnSide | string): ColumnSide;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static Left : ColumnSide;
|
|
20
|
+
static Right : ColumnSide;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
constructor(value: ColumnSide | string );
|
|
24
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Where a new column goes relative to the selected columns.
|
|
9
|
+
*/
|
|
10
|
+
export class ColumnSide {
|
|
11
|
+
#value = undefined;
|
|
12
|
+
|
|
13
|
+
static #values = new Map([
|
|
14
|
+
["Left", 0],
|
|
15
|
+
["Right", 1]
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
static getAllEntries() {
|
|
19
|
+
return ColumnSide.#values.entries();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#internalConstructor(value) {
|
|
23
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
24
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
25
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
26
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
27
|
+
this.#value = arguments[2];
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
return ColumnSide.#objectValues[arguments[1]];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (value instanceof ColumnSide) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let intVal = ColumnSide.#values.get(value);
|
|
38
|
+
|
|
39
|
+
// Nullish check, checks for null or undefined
|
|
40
|
+
if (intVal != null) {
|
|
41
|
+
return ColumnSide.#objectValues[intVal];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
throw TypeError(value + " is not a ColumnSide and does not correspond to any of its enumerator values.");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
static fromValue(value) {
|
|
49
|
+
return new ColumnSide(value);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get value(){
|
|
53
|
+
return [...ColumnSide.#values.keys()][this.#value];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
get ffiValue(){
|
|
58
|
+
return this.#value;
|
|
59
|
+
}
|
|
60
|
+
static #objectValues = [
|
|
61
|
+
new ColumnSide(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
|
|
62
|
+
new ColumnSide(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
static Left = ColumnSide.#objectValues[0];
|
|
66
|
+
static Right = ColumnSide.#objectValues[1];
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
constructor(value) {
|
|
70
|
+
return this.#internalConstructor(...arguments)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The kind of content control.
|
|
8
|
+
*/
|
|
9
|
+
export class ControlKind {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: ControlKind | string): ControlKind;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
static PlainText : ControlKind;
|
|
20
|
+
static RichText : ControlKind;
|
|
21
|
+
static Picture : ControlKind;
|
|
22
|
+
static Checkbox : ControlKind;
|
|
23
|
+
static Date : ControlKind;
|
|
24
|
+
static Group : ControlKind;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
constructor(value: ControlKind | string );
|
|
28
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The kind of content control.
|
|
9
|
+
*/
|
|
10
|
+
export class ControlKind {
|
|
11
|
+
#value = undefined;
|
|
12
|
+
|
|
13
|
+
static #values = new Map([
|
|
14
|
+
["PlainText", 0],
|
|
15
|
+
["RichText", 1],
|
|
16
|
+
["Picture", 2],
|
|
17
|
+
["Checkbox", 3],
|
|
18
|
+
["Date", 4],
|
|
19
|
+
["Group", 5]
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
static getAllEntries() {
|
|
23
|
+
return ControlKind.#values.entries();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#internalConstructor(value) {
|
|
27
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
28
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
29
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
30
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
31
|
+
this.#value = arguments[2];
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
return ControlKind.#objectValues[arguments[1]];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (value instanceof ControlKind) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let intVal = ControlKind.#values.get(value);
|
|
42
|
+
|
|
43
|
+
// Nullish check, checks for null or undefined
|
|
44
|
+
if (intVal != null) {
|
|
45
|
+
return ControlKind.#objectValues[intVal];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
throw TypeError(value + " is not a ControlKind and does not correspond to any of its enumerator values.");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
static fromValue(value) {
|
|
53
|
+
return new ControlKind(value);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get value(){
|
|
57
|
+
return [...ControlKind.#values.keys()][this.#value];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
get ffiValue(){
|
|
62
|
+
return this.#value;
|
|
63
|
+
}
|
|
64
|
+
static #objectValues = [
|
|
65
|
+
new ControlKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
|
|
66
|
+
new ControlKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
67
|
+
new ControlKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
|
|
68
|
+
new ControlKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3),
|
|
69
|
+
new ControlKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4),
|
|
70
|
+
new ControlKind(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5),
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
static PlainText = ControlKind.#objectValues[0];
|
|
74
|
+
static RichText = ControlKind.#objectValues[1];
|
|
75
|
+
static Picture = ControlKind.#objectValues[2];
|
|
76
|
+
static Checkbox = ControlKind.#objectValues[3];
|
|
77
|
+
static Date = ControlKind.#objectValues[4];
|
|
78
|
+
static Group = ControlKind.#objectValues[5];
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
constructor(value) {
|
|
82
|
+
return this.#internalConstructor(...arguments)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What a content control's lock prevents.
|
|
8
|
+
*/
|
|
9
|
+
export class ControlLock {
|
|
10
|
+
|
|
11
|
+
/** @internal */
|
|
12
|
+
static fromValue(value: ControlLock | string): ControlLock;
|
|
13
|
+
|
|
14
|
+
get value(): string;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
get ffiValue(): number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Keeps the current lock (no lock for a new control).
|
|
21
|
+
*/
|
|
22
|
+
static Unchanged : ControlLock;
|
|
23
|
+
/**
|
|
24
|
+
* Nothing is locked.
|
|
25
|
+
*/
|
|
26
|
+
static Unlocked : ControlLock;
|
|
27
|
+
/**
|
|
28
|
+
* The control can't be deleted.
|
|
29
|
+
*/
|
|
30
|
+
static Control : ControlLock;
|
|
31
|
+
/**
|
|
32
|
+
* The content can't be edited.
|
|
33
|
+
*/
|
|
34
|
+
static Content : ControlLock;
|
|
35
|
+
/**
|
|
36
|
+
* Neither the control can be deleted nor its content edited.
|
|
37
|
+
*/
|
|
38
|
+
static Both : ControlLock;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
constructor(value: ControlLock | string );
|
|
42
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import wasm from "./diplomat-wasm.mjs";
|
|
3
|
+
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What a content control's lock prevents.
|
|
9
|
+
*/
|
|
10
|
+
export class ControlLock {
|
|
11
|
+
#value = undefined;
|
|
12
|
+
|
|
13
|
+
static #values = new Map([
|
|
14
|
+
["Unchanged", 0],
|
|
15
|
+
["Unlocked", 1],
|
|
16
|
+
["Control", 2],
|
|
17
|
+
["Content", 3],
|
|
18
|
+
["Both", 4]
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
static getAllEntries() {
|
|
22
|
+
return ControlLock.#values.entries();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#internalConstructor(value) {
|
|
26
|
+
if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) {
|
|
27
|
+
// We pass in two internalConstructor arguments to create *new*
|
|
28
|
+
// instances of this type, otherwise the enums are treated as singletons.
|
|
29
|
+
if (arguments[1] === diplomatRuntime.internalConstructor ) {
|
|
30
|
+
this.#value = arguments[2];
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
return ControlLock.#objectValues[arguments[1]];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (value instanceof ControlLock) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let intVal = ControlLock.#values.get(value);
|
|
41
|
+
|
|
42
|
+
// Nullish check, checks for null or undefined
|
|
43
|
+
if (intVal != null) {
|
|
44
|
+
return ControlLock.#objectValues[intVal];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
throw TypeError(value + " is not a ControlLock and does not correspond to any of its enumerator values.");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
static fromValue(value) {
|
|
52
|
+
return new ControlLock(value);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get value(){
|
|
56
|
+
return [...ControlLock.#values.keys()][this.#value];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
get ffiValue(){
|
|
61
|
+
return this.#value;
|
|
62
|
+
}
|
|
63
|
+
static #objectValues = [
|
|
64
|
+
new ControlLock(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
|
|
65
|
+
new ControlLock(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
|
|
66
|
+
new ControlLock(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
|
|
67
|
+
new ControlLock(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3),
|
|
68
|
+
new ControlLock(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4),
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Keeps the current lock (no lock for a new control).
|
|
73
|
+
*/
|
|
74
|
+
static Unchanged = ControlLock.#objectValues[0];
|
|
75
|
+
/**
|
|
76
|
+
* Nothing is locked.
|
|
77
|
+
*/
|
|
78
|
+
static Unlocked = ControlLock.#objectValues[1];
|
|
79
|
+
/**
|
|
80
|
+
* The control can't be deleted.
|
|
81
|
+
*/
|
|
82
|
+
static Control = ControlLock.#objectValues[2];
|
|
83
|
+
/**
|
|
84
|
+
* The content can't be edited.
|
|
85
|
+
*/
|
|
86
|
+
static Content = ControlLock.#objectValues[3];
|
|
87
|
+
/**
|
|
88
|
+
* Neither the control can be deleted nor its content edited.
|
|
89
|
+
*/
|
|
90
|
+
static Both = ControlLock.#objectValues[4];
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
constructor(value) {
|
|
94
|
+
return this.#internalConstructor(...arguments)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
export type DocumentStatus_obj = {
|
|
5
|
+
page: number;
|
|
6
|
+
pages: number;
|
|
7
|
+
words: number;
|
|
8
|
+
zoom: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The status bar's numbers.
|
|
15
|
+
*/
|
|
16
|
+
export class DocumentStatus {
|
|
17
|
+
get page(): number;
|
|
18
|
+
set page(value: number);
|
|
19
|
+
get pages(): number;
|
|
20
|
+
set pages(value: number);
|
|
21
|
+
get words(): number;
|
|
22
|
+
set words(value: number);
|
|
23
|
+
get zoom(): number;
|
|
24
|
+
set zoom(value: number);
|
|
25
|
+
/** @internal */
|
|
26
|
+
static fromFields(structObj : DocumentStatus_obj) : DocumentStatus;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create `DocumentStatus` from an object that contains all of `DocumentStatus`s fields.
|
|
30
|
+
* Optional fields do not need to be included in the provided object.
|
|
31
|
+
*/
|
|
32
|
+
constructor(structObj: DocumentStatus_obj);
|
|
33
|
+
|
|
34
|
+
}
|