Add more type definitions (#882)

* More typing to base.ts

* Add more types

* More types
This commit is contained in:
Fábio Rosado
2022-10-27 23:48:28 +01:00
committed by GitHub
parent 4850f39b5a
commit 1c53d91c6b
13 changed files with 115 additions and 29 deletions

View File

@@ -37,7 +37,7 @@ export function ltrim(code: string): string {
let _uniqueIdCounter = 0;
export function ensureUniqueId(el: HTMLElement) {
if (el.id === "")
el.id = "py-internal-" + _uniqueIdCounter++;
el.id = `py-internal-${_uniqueIdCounter++}`;
}
/*
@@ -94,7 +94,7 @@ export function inJest(): boolean {
return typeof process === 'object' && process.env.JEST_WORKER_ID !== undefined;
}
export function globalExport(name: string, obj: any) {
export function globalExport(name: string, obj: object) {
// attach the given object to the global object, so that it is globally
// visible everywhere. Should be used very sparingly!