UNPKG

874 BPlain TextView Raw
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4/* eslint-disable @typescript-eslint/no-explicit-any */
5
6import * as z from 'zod';
7import { INodeBuffer, INodeSocket } from 'botframework-streaming';
8import { TurnContext } from 'botbuilder-core';
9
10export const INodeBufferT = z.custom<INodeBuffer>(Buffer.isBuffer, { message: 'INodeBufferT' });
11
12export 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
24export const LogicT = z.custom<(context: TurnContext) => Promise<void>>((val) => typeof val === 'function');
25
\No newline at end of file