Skip to content

Commit b328546

Browse files
author
Guy Bedford
authored
fix: typing file for compute builtin (#1028)
1 parent 9e47649 commit b328546

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

test-d/compute.test-d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path="../types/compute.d.ts" />
2+
import { vCpuTime, purgeSurrogateKey } from 'fastly:compute';
3+
import { expectType } from 'tsd';
4+
5+
// Compute
6+
{
7+
expectType<number>(vCpuTime());
8+
expectType<boolean>(purgeSurrogateKey('boo'));
9+
}

types/compute.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ declare module 'fastly:compute' {
1010
* @param soft - Enable to perform a soft purge, retaining stale cache entries to
1111
* reduce load on the origin server, defaults to a hard purge.
1212
*/
13-
export function purgeSurrogateKey(surrogateKey: string, soft?: boolean);
13+
export function purgeSurrogateKey(
14+
surrogateKey: string,
15+
soft?: boolean,
16+
): boolean;
1417
}

0 commit comments

Comments
 (0)