1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import * as z from 'zod';
|
7 | import { INodeBuffer, INodeSocket } from 'botframework-streaming';
|
8 | import { TurnContext } from 'botbuilder-core';
|
9 |
|
10 | export const INodeBufferT = z.custom<INodeBuffer>(Buffer.isBuffer, { message: 'INodeBufferT' });
|
11 |
|
12 | export const INodeSocketT = z.custom<INodeSocket>(
|
13 | (val: any) =>
|
14 | typeof val.emit === 'function' &&
|
15 | typeof val.end === 'function' &&
|
16 | typeof val.off === 'function' &&
|
17 | typeof val.on === 'function' &&
|
18 | typeof val.once === 'function' &&
|
19 | typeof val.pipe === 'function' &&
|
20 | typeof val.write === 'function',
|
21 | { message: 'INodeSocket' }
|
22 | );
|
23 |
|
24 | export const LogicT = z.custom<(context: TurnContext) => Promise<void>>((val) => typeof val === 'function');
|
25 |
|
\ | No newline at end of file |