UNPKG

@design.estate/dees-domtools

Version:

A package providing tools to simplify complex CSS structures and web development tasks, featuring TypeScript support and integration with various web technologies.

73 lines (72 loc) 2.76 kB
import * as plugins from './domtools.plugins.js'; import { type TViewport } from './domtools.css.breakpoints.js'; import { WebSetup } from '@push.rocks/websetup'; import { ThemeManager } from './domtools.classes.thememanager.js'; import { Keyboard } from './domtools.classes.keyboard.js'; export interface IDomToolsState { virtualViewport: TViewport; jwt: string; } export interface IDomToolsContructorOptions { ignoreGlobal?: boolean; } export declare class DomTools { /** * setups domtools */ static setupDomTools(optionsArg?: IDomToolsContructorOptions): Promise<DomTools>; /** * if you can, use the static asysnc .setupDomTools() function instead since it is safer to use. */ static getGlobalDomToolsSync(): DomTools; elements: { headElement: HTMLElement; bodyElement: HTMLElement; }; websetup: WebSetup; smartstate: plugins.smartstate.Smartstate<string>; domToolsStatePart: Promise<plugins.smartstate.StatePart<string, IDomToolsState>>; router: plugins.smartrouter.SmartRouter; convenience: { typedrequest: typeof plugins.typedrequest; smartdelay: typeof plugins.smartdelay; smartjson: typeof plugins.smartjson; smarturl: typeof plugins.smarturl; }; deesComms: plugins.deesComms.DeesComms; scroller: plugins.SweetScroll; themeManager: ThemeManager; keyboard: Keyboard; domToolsReady: plugins.smartpromise.Deferred<unknown>; domReady: plugins.smartpromise.Deferred<unknown>; globalStylesReady: plugins.smartpromise.Deferred<unknown>; constructor(optionsArg: IDomToolsContructorOptions); private runOnceTrackerStringMap; private runOnceResultMap; /** * run a function once and always get the Promise of the first execution * @param identifierArg the indentifier arg identifies functions. functions with the same identifier are considered equal * @param funcArg the actual func arg to run */ runOnce<T>(identifierArg: string, funcArg: () => Promise<T>): Promise<unknown>; /** * allows to set global styles * @param stylesText the css text you want to set */ setGlobalStyles(stylesText: string): Promise<void>; /** * allows to set global styles * @param stylesText the css text you want to set */ setExternalScript(scriptLinkArg: string): Promise<void>; /** * allows setting external css files * @param cssLinkArg a url to an external stylesheet */ setExternalCss(cssLinkArg: string): Promise<void>; /** * allows setting of website infos * @param optionsArg the website info */ setWebsiteInfo(optionsArg: plugins.websetup.IWebSetupConstructorOptions): Promise<void>; }