@@ -110,7 +110,7 @@ export interface LegacyEvent {
110
110
// @public
111
111
export interface OpenFunction {
112
112
// (undocumented)
113
- (ctx : OpenFunctionRuntime , data : {} ): any ;
113
+ (ctx : OpenFunctionRuntime , data : object ): any ;
114
114
}
115
115
116
116
// @public
@@ -136,8 +136,8 @@ export interface OpenFunctionContext {
136
136
name: string ;
137
137
outputs? : OpenFunctionBinding ;
138
138
port? : string ;
139
- postPlugins? : Array < string | Plugin_2 | undefined > ;
140
- prePlugins? : Array < string | Plugin_2 | undefined > ;
139
+ postPlugins? : string [] ;
140
+ prePlugins? : string [] ;
141
141
runtime: ` ${RuntimeType } ` | ` ${Capitalize <RuntimeType >} ` | ` ${Uppercase <RuntimeType >} ` ;
142
142
version: string ;
143
143
}
@@ -146,6 +146,8 @@ export interface OpenFunctionContext {
146
146
export abstract class OpenFunctionRuntime {
147
147
constructor (context : OpenFunctionContext );
148
148
protected readonly context: OpenFunctionContext ;
149
+ getPlugin(name : string ): Plugin_2 ;
150
+ readonly locals: Record <string , any >;
149
151
static Parse(context : OpenFunctionContext ): OpenFunctionRuntime ;
150
152
static ProxyContext(context : OpenFunctionContext ): OpenFunctionRuntime ;
151
153
get req(): Request_3 <ParamsDictionary , any , any , ParsedQs , Record <string , any >> | undefined ;
@@ -158,17 +160,17 @@ export abstract class OpenFunctionRuntime {
158
160
};
159
161
// Warning: (ae-forgotten-export) The symbol "OpenFunctionTrigger" needs to be exported by the entry point index.d.ts
160
162
protected trigger? : OpenFunctionTrigger ;
163
+ static WrapUserFunction(userFunction : OpenFunction , context : OpenFunctionContext | OpenFunctionRuntime ): (data : any ) => Promise <void >;
161
164
}
162
165
163
166
// @public
164
167
class Plugin_2 {
165
- execPostHook(ctx ? : OpenFunctionRuntime ): Promise <void >;
166
- execPreHook(ctx ? : OpenFunctionRuntime ): Promise <void >;
167
- get(filedName : string ): string ;
168
- // (undocumented)
169
- static OFN_PLUGIN_NAME: string ;
170
- // (undocumented)
171
- static OFN_PLUGIN_VERSION: string ;
168
+ constructor (name : string , version ? : string );
169
+ execPostHook(ctx : OpenFunctionRuntime | null , plugins : Record <string , Plugin_2 >): Promise <void >;
170
+ execPreHook(ctx : OpenFunctionRuntime | null , plugins : Record <string , Plugin_2 >): Promise <void >;
171
+ get(prop : string ): any ;
172
+ readonly name: string ;
173
+ readonly version: string ;
172
174
}
173
175
export { Plugin_2 as Plugin }
174
176
0 commit comments