Skip to content

Commit

Permalink
feat: add all global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaoumov committed Sep 17, 2024
1 parent 12b7a12 commit 17cbd22
Show file tree
Hide file tree
Showing 27 changed files with 909 additions and 33 deletions.
10 changes: 10 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"autocompletions",
"backlink",
"backlinks",
"blinkfetch",
"bodgy",
"btime",
"Callout",
Expand All @@ -17,6 +18,7 @@
"csscache",
"datetime",
"Debouncer",
"dompurify",
"dprint",
"dragevent",
"emacsy",
Expand All @@ -26,17 +28,21 @@
"flexgrow",
"Frameless",
"Frontmatter",
"Haverbeke",
"HTMLI",
"Keydown",
"Keymap",
"keyof",
"Keyscope",
"lezer",
"linewise",
"linkpath",
"linktext",
"localgraph",
"localstorage",
"Lucide",
"mapclear",
"Marijn",
"mathjax",
"metadatacache",
"minifier",
Expand All @@ -45,9 +51,11 @@
"Naumov",
"nocheck",
"nodenext",
"noremap",
"obsdmd",
"onunload",
"Parens",
"PIXI",
"Popout",
"preapproved",
"precompute",
Expand All @@ -57,12 +65,14 @@
"reparent",
"Sidedock",
"tablecell",
"titlebar",
"toggleable",
"tsdoc",
"Uncollapse",
"uncollapsed",
"unfocus",
"Unindents",
"unmap",
"Watchpath",
"wikilink",
"Wikilinks"
Expand Down
101 changes: 95 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@
"obsidian": "^1.6.6"
},
"devDependencies": {
"@capacitor/core": "^6.1.2",
"@codemirror/search": "^6.5.6",
"@codemirror/state": "^6.4.1",
"@microsoft/api-extractor": "^7.47.9",
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^18.17.0 || >=20.1.0",
"@types/turndown": "^5.0.5",
"builtin-modules": "^4.0.0",
"cspell": "^8.14.2",
"dprint": "^0.47.2",
"dts-bundle-generator": "^9.5.1",
"esbuild": "^0.23.1",
"i18next": "^23.15.1",
"npm-run-all": "^4.1.5",
"ts-morph": "^23.0.0"
},
Expand Down
17 changes: 17 additions & 0 deletions src/@codemirror__view/internals/Bookmark.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ChangeDesc } from '@codemirror/state';
import type { EditorPosition } from 'obsidian';
import type { CodeMirrorEditor } from './CodeMirrorEditor.js';

/**
* @public
*/
export interface Bookmark {
cm: CodeMirrorEditor;
id: number;
offset: number;
assoc: number;

clear(): void;
find(): EditorPosition | null;
update(changeDesc: ChangeDesc): void;
}
71 changes: 71 additions & 0 deletions src/@codemirror__view/internals/CodeMirrorAdapter2.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import type {
EditorPosition,
Pos
} from 'obsidian';
import type { CodeMirrorEditor } from './CodeMirrorEditor.js';
import type { EditorRange2 } from './EditorRange2.js';
import type { VimApi } from './VimApi.js';
import type { VimEditor } from './VimEditor.js';

/**
* @public
*/
export interface CodeMirrorAdapter2 {
new(cm6: VimEditor): CodeMirrorEditor;

Vim: VimApi;

isMac: boolean;

Pos: new(line: number, ch: number) => EditorPosition;

StringStream: unknown;

commands: {
cursorCharLeft: (editor: CodeMirrorEditor) => void;
redo: (editor: CodeMirrorEditor) => void;
undo: (editor: CodeMirrorEditor) => void;
newlineAndIndent: (editor: CodeMirrorEditor) => void;
newlineAndIndentBefore: (editor: CodeMirrorEditor) => void;
indentAuto: (editor: CodeMirrorEditor) => void;
};

defineOption(option: string, defaultValue: unknown, handler: () => void): void;

isWordChar(char: string): boolean;

keys: Record<string, unknown>;

keyMap: Record<string, unknown>;

addClass(element: HTMLElement, className: string): void;

rmClass(element: HTMLElement, className: string): void;

e_preventDefault(event: Event): void;

e_stop(event: Event): void;

keyName(event: KeyboardEvent): string;

vimKey(event: KeyboardEvent): string;

lookupKey(
key: string,
context: unknown,
callback: (action: (codeMirrorAdapter: CodeMirrorAdapter2) => boolean) => void
): void;

on(event: string, listener: EventListenerOrEventListenerObject): void;

off(event: string, listener: EventListenerOrEventListenerObject): void;

signal(target: unknown, type: string, ...values: unknown[]): void;

findMatchingTag(doc: CodeMirrorAdapter2, pos: EditorPosition): void;

findEnclosingTag(doc: CodeMirrorAdapter2, pos: EditorPosition): {
open: EditorRange2;
close: EditorRange2;
} | undefined;
}
Loading

0 comments on commit 17cbd22

Please sign in to comment.