@punica/editor 1.51.0 → 1.52.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/package.json +1 -1
- package/types/vendor/monaco-editor.d.ts +109 -0
package/package.json
CHANGED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Monaco surface the hosts ship, for extensions that do not install it.
|
|
3
|
+
*
|
|
4
|
+
* `monaco-editor` is the product's, not an extension's: both hosts map the
|
|
5
|
+
* bare specifier to one shared `monaco-editor.bundle.js` through the renderer
|
|
6
|
+
* import map (punica-editor-browser/vendor/monaco-vendor.ts, monaco-editor
|
|
7
|
+
* ^0.53.0 in both hosts' package.json), and an extension keeps it `external`
|
|
8
|
+
* in rollup. Installing the package only for its types puts ~70 MB in every
|
|
9
|
+
* extension's node_modules and lets an extension compile against API the
|
|
10
|
+
* host's core-only bundle does not carry.
|
|
11
|
+
*
|
|
12
|
+
* **Opt in through tsconfig `paths`**, the way `punica` is mapped:
|
|
13
|
+
*
|
|
14
|
+
* "paths": {
|
|
15
|
+
* "punica": ["node_modules/@punica/editor/types"],
|
|
16
|
+
* "monaco-editor": ["node_modules/@punica/editor/types/vendor/monaco-editor"]
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* It is a module, not an ambient `declare module`, and it is deliberately not
|
|
20
|
+
* referenced from `types/index.d.ts`: an extension that does install the real
|
|
21
|
+
* package (extension-code-editor uses far more of it) must keep resolving to
|
|
22
|
+
* that one.
|
|
23
|
+
*
|
|
24
|
+
* Only what an extension in the fleet calls is declared. Widen it when a
|
|
25
|
+
* caller needs more — and check the member exists in the host's bundle,
|
|
26
|
+
* which is the core editor plus the python, markdown, sql, typescript and
|
|
27
|
+
* javascript tokenizers, no language services and no workers.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export interface IDisposable {
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IPosition {
|
|
35
|
+
lineNumber: number;
|
|
36
|
+
column: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IRange {
|
|
40
|
+
startLineNumber: number;
|
|
41
|
+
startColumn: number;
|
|
42
|
+
endLineNumber: number;
|
|
43
|
+
endColumn: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export enum MarkerSeverity {
|
|
47
|
+
Hint = 1,
|
|
48
|
+
Info = 2,
|
|
49
|
+
Warning = 4,
|
|
50
|
+
Error = 8,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export namespace editor {
|
|
54
|
+
interface IMarkerData extends IRange {
|
|
55
|
+
severity: MarkerSeverity;
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ITextModel {
|
|
60
|
+
getValue(): string;
|
|
61
|
+
getFullModelRange(): IRange;
|
|
62
|
+
getPositionAt(offset: number): IPosition;
|
|
63
|
+
getOffsetAt(position: IPosition): number;
|
|
64
|
+
pushEditOperations(
|
|
65
|
+
beforeCursorState: unknown[] | null,
|
|
66
|
+
editOperations: { range: IRange; text: string }[],
|
|
67
|
+
cursorStateComputer: () => unknown[] | null
|
|
68
|
+
): unknown;
|
|
69
|
+
pushStackElement(): void;
|
|
70
|
+
dispose(): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface IStandaloneCodeEditor {
|
|
74
|
+
getValue(): string;
|
|
75
|
+
setValue(value: string): void;
|
|
76
|
+
getModel(): ITextModel | null;
|
|
77
|
+
focus(): void;
|
|
78
|
+
dispose(): void;
|
|
79
|
+
layout(): void;
|
|
80
|
+
setSelection(range: IRange): void;
|
|
81
|
+
revealRangeInCenterIfOutsideViewport(range: IRange): void;
|
|
82
|
+
onDidChangeModelContent(listener: () => void): IDisposable;
|
|
83
|
+
updateOptions(options: Record<string, unknown>): void;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function create(
|
|
87
|
+
host: HTMLElement,
|
|
88
|
+
options: Record<string, unknown>
|
|
89
|
+
): IStandaloneCodeEditor;
|
|
90
|
+
function setTheme(theme: string): void;
|
|
91
|
+
function setModelMarkers(
|
|
92
|
+
model: ITextModel,
|
|
93
|
+
owner: string,
|
|
94
|
+
markers: IMarkerData[]
|
|
95
|
+
): void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export namespace languages {
|
|
99
|
+
function register(language: { id: string; extensions?: string[] }): void;
|
|
100
|
+
function getLanguages(): { id: string }[];
|
|
101
|
+
function setMonarchTokensProvider(
|
|
102
|
+
languageId: string,
|
|
103
|
+
language: Record<string, unknown>
|
|
104
|
+
): IDisposable;
|
|
105
|
+
function setLanguageConfiguration(
|
|
106
|
+
languageId: string,
|
|
107
|
+
configuration: Record<string, unknown>
|
|
108
|
+
): IDisposable;
|
|
109
|
+
}
|