Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add fastly:experimental module which contains all our experimen…
…tal functions such as includeBytes and enableDebugLogging
- Loading branch information
1 parent
919bf0d
commit 5c6a5d7
Showing
5 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// <reference path="../types/fastly:experimental.d.ts" /> | ||
import { setBaseURL, setDefaultBackend, enableDebugLogging, includeBytes } from "fastly:experimental"; | ||
import { expectType } from 'tsd'; | ||
|
||
expectType<(path: string) => Uint8Array>(includeBytes) | ||
expectType<(enabled: boolean) => void>(enableDebugLogging) | ||
expectType<(base: URL | null | undefined) => void>(setBaseURL) | ||
expectType<(backend: string) => void>(setDefaultBackend) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @experimental | ||
*/ | ||
declare module "fastly:experimental" { | ||
/** | ||
* @experimental | ||
*/ | ||
export function setBaseURL(base: URL | null | undefined): void; | ||
/** | ||
* @experimental | ||
*/ | ||
export function setDefaultBackend(backend: string): void; | ||
/** | ||
* Causes the Compute@Edge JS runtime environment to log debug information to stdout. | ||
* | ||
* **Note**: This is mostly for internal debugging purposes and will generate highly unstable | ||
* output. | ||
* @experimental | ||
*/ | ||
export function enableDebugLogging(enabled: boolean): void; | ||
|
||
/** | ||
* Embed a file as a Uint8Array. | ||
* | ||
* @param path - The path to include, relative to the project's top-level directory | ||
* | ||
* **Note**: Can only be used during build-time initialization, not when processing requests. | ||
* @experimental | ||
*/ | ||
export function includeBytes(path: string): Uint8Array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters