Skip to content

Commit 9089abd

Browse files
committed
📝 doc(api): update function context typings
1 parent 7d1aee1 commit 9089abd

File tree

2 files changed

+55
-12
lines changed

2 files changed

+55
-12
lines changed

docs/generated/api.json

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,9 +1522,14 @@
15221522
"kind": "Content",
15231523
"text": "metadata?: "
15241524
},
1525+
{
1526+
"kind": "Reference",
1527+
"text": "Record",
1528+
"canonicalReference": "!Record:type"
1529+
},
15251530
{
15261531
"kind": "Content",
1527-
"text": "{\n [key: string]: string;\n }"
1532+
"text": "<string, string>"
15281533
},
15291534
{
15301535
"kind": "Content",
@@ -1536,7 +1541,7 @@
15361541
"name": "metadata",
15371542
"propertyTypeTokenRange": {
15381543
"startIndex": 1,
1539-
"endIndex": 2
1544+
"endIndex": 3
15401545
}
15411546
},
15421547
{
@@ -1724,13 +1729,53 @@
17241729
},
17251730
{
17261731
"kind": "Content",
1727-
"text": "keyof typeof "
1732+
"text": "`${"
1733+
},
1734+
{
1735+
"kind": "Reference",
1736+
"text": "RuntimeType",
1737+
"canonicalReference": "@openfunction/functions-framework!RuntimeType:enum"
1738+
},
1739+
{
1740+
"kind": "Content",
1741+
"text": "}` | `${"
1742+
},
1743+
{
1744+
"kind": "Reference",
1745+
"text": "Capitalize",
1746+
"canonicalReference": "!Capitalize:type"
1747+
},
1748+
{
1749+
"kind": "Content",
1750+
"text": "<"
17281751
},
17291752
{
17301753
"kind": "Reference",
17311754
"text": "RuntimeType",
17321755
"canonicalReference": "@openfunction/functions-framework!RuntimeType:enum"
17331756
},
1757+
{
1758+
"kind": "Content",
1759+
"text": ">}` | `${"
1760+
},
1761+
{
1762+
"kind": "Reference",
1763+
"text": "Uppercase",
1764+
"canonicalReference": "!Uppercase:type"
1765+
},
1766+
{
1767+
"kind": "Content",
1768+
"text": "<"
1769+
},
1770+
{
1771+
"kind": "Reference",
1772+
"text": "RuntimeType",
1773+
"canonicalReference": "@openfunction/functions-framework!RuntimeType:enum"
1774+
},
1775+
{
1776+
"kind": "Content",
1777+
"text": ">}`"
1778+
},
17341779
{
17351780
"kind": "Content",
17361781
"text": ";"
@@ -1741,7 +1786,7 @@
17411786
"name": "runtime",
17421787
"propertyTypeTokenRange": {
17431788
"startIndex": 1,
1744-
"endIndex": 3
1789+
"endIndex": 12
17451790
}
17461791
},
17471792
{
@@ -1854,7 +1899,7 @@
18541899
},
18551900
{
18561901
"kind": "Content",
1857-
"text": "\"Async\""
1902+
"text": "\"async\""
18581903
}
18591904
],
18601905
"releaseTag": "Public",
@@ -1875,7 +1920,7 @@
18751920
},
18761921
{
18771922
"kind": "Content",
1878-
"text": "\"Knative\""
1923+
"text": "\"knative\""
18791924
}
18801925
],
18811926
"releaseTag": "Public",

docs/generated/api.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ export interface OpenFunctionBinding {
114114
export interface OpenFunctionComponent {
115115
componentName: string;
116116
componentType: `${ComponentType}.${string}`;
117-
metadata?: {
118-
[key: string]: string;
119-
};
117+
metadata?: Record<string, string>;
120118
operation?: string;
121119
uri?: string;
122120
}
@@ -127,7 +125,7 @@ export interface OpenFunctionContext {
127125
name: string;
128126
outputs?: OpenFunctionBinding;
129127
port?: string;
130-
runtime: keyof typeof RuntimeType;
128+
runtime: `${RuntimeType}` | `${Capitalize<RuntimeType>}` | `${Uppercase<RuntimeType>}`;
131129
version: string;
132130
}
133131

@@ -141,8 +139,8 @@ export { Response_2 as Response }
141139

142140
// @public
143141
export enum RuntimeType {
144-
Async = "Async",
145-
Knative = "Knative"
142+
Async = "async",
143+
Knative = "knative"
146144
}
147145

148146
// (No @packageDocumentation comment for this package)

0 commit comments

Comments
 (0)