datagrok-ai / public

Public package repository for the Datagrok.ai platform
MIT License
43 stars 26 forks source link

#2996: Tools: extract global variables in global.d.ts file in typescript template #2996

Open santee opened 1 month ago

santee commented 1 month ago

Move external dependencies (environment vars, essentially) into a separate global.d.ts file, remove corresponding lines from package.ts

An example of such file is

import * as grokNamespace from 'datagrok-api/grok';
import * as uiNamespace from 'datagrok-api/ui';
import * as DGNamespace from 'datagrok-api/dg';
import * as rxjsNamespace from 'rxjs';
import $Namespace from 'cash-dom';

declare global {
    const grok: typeof grokNamespace;
    const ui: typeof uiNamespace;
    const DG: typeof DGNamespace;
    const rjxs: typeof rxjsNamespace;
    const $: typeof $Namespace;
}
dnillovna commented 1 month ago

This issue has been mirrored in Jira: https://reddata.atlassian.net/browse/GROK-16508