songstress/sandbox
The globals an entry's code finds in the sandbox, for the compiler.
songstress/sandbox exports nothing to import: it declares the globals an entry's code finds in Songstress's
sandbox, and nothing more. Name it in your extension's tsconfig.json, and code that reaches for fetch,
process, window or document does not compile, which is the truth: they are not there. The way to the network
is songstress.net.fetch.
{ "compilerOptions": { "lib": ["ES2023"], "types": ["songstress/sandbox"] } }Each global, and every description, is read from the SDK's sandbox.d.ts when the site is built.
Console
The extension's log: songstress dev prints it, and the server keeps the last of it for its admin.
Prop
Type
console
The extension's log.
declare var console: ConsolesetTimeout
Calls handler once, after ms milliseconds. A timer does not keep a call alive past the promise its handler returned.
declare function setTimeout(handler: (...args: never[]) => void, ms?: number, ...args: unknown[]): number| Parameter | Type | Description |
|---|---|---|
handler | (...args: never[]) => void | What to call. |
ms? | number | How long to wait, in milliseconds. |
...args | unknown[] | What handler is called with. |
Returns number: The timer's id, for clearTimeout.
setInterval
Calls handler every ms milliseconds, until clearInterval. Like every timer, it does not keep a call alive past the promise its handler returned.
declare function setInterval(handler: (...args: never[]) => void, ms?: number, ...args: unknown[]): number| Parameter | Type | Description |
|---|---|---|
handler | (...args: never[]) => void | What to call. |
ms? | number | How long between calls, in milliseconds. |
...args | unknown[] | What handler is called with. |
Returns number: The timer's id, for clearInterval.
clearTimeout
Stops a timer setTimeout set.
declare function clearTimeout(id: number | undefined): void| Parameter | Type | Description |
|---|---|---|
id | number | undefined | The timer's id. |
Returns void.
clearInterval
Stops a timer setInterval set.
declare function clearInterval(id: number | undefined): void| Parameter | Type | Description |
|---|---|---|
id | number | undefined | The timer's id. |
Returns void.