mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-08-29 23:07:08 +00:00
Complete Commonlib rc.6 integration and setup workflows
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Native DOM creation for browser applications which run outside Obsidian.
|
||||
*
|
||||
* Obsidian adds creation helpers to its own DOM environment. The standalone
|
||||
* Webapp and WebPeer hosts do not own those prototype extensions, and the
|
||||
* Webapp compatibility layer implements them on top of this native boundary.
|
||||
*/
|
||||
type NativeDocumentCreation = Pick<Document, "createElement" | "createDocumentFragment">;
|
||||
|
||||
export function createNativeElement<K extends keyof HTMLElementTagNameMap>(
|
||||
document: NativeDocumentCreation,
|
||||
tag: K
|
||||
): HTMLElementTagNameMap[K];
|
||||
export function createNativeElement(document: NativeDocumentCreation, tag: string): HTMLElement;
|
||||
export function createNativeElement(document: NativeDocumentCreation, tag: string): HTMLElement {
|
||||
return document.createElement(tag);
|
||||
}
|
||||
|
||||
export function createNativeFragment(document: NativeDocumentCreation): DocumentFragment {
|
||||
return document.createDocumentFragment();
|
||||
}
|
||||
Reference in New Issue
Block a user