1 | import { Collation } from './collation';
|
2 | import Parser, { type ParserOptions } from './token/stream-parser';
|
3 | import { type DataType } from './data-type';
|
4 | import { type CryptoMetadata } from './always-encrypted/types';
|
5 | import { Result } from './token/helpers';
|
6 | interface XmlSchema {
|
7 | dbname: string;
|
8 | owningSchema: string;
|
9 | xmlSchemaCollection: string;
|
10 | }
|
11 | interface UdtInfo {
|
12 | maxByteSize: number;
|
13 | dbname: string;
|
14 | owningSchema: string;
|
15 | typeName: string;
|
16 | assemblyName: string;
|
17 | }
|
18 | export type BaseMetadata = {
|
19 | userType: number;
|
20 | flags: number;
|
21 | |
22 |
|
23 |
|
24 | type: DataType;
|
25 | collation: Collation | undefined;
|
26 | |
27 |
|
28 |
|
29 | precision: number | undefined;
|
30 | |
31 |
|
32 |
|
33 | scale: number | undefined;
|
34 | |
35 |
|
36 |
|
37 | dataLength: number | undefined;
|
38 | schema: XmlSchema | undefined;
|
39 | udtInfo: UdtInfo | undefined;
|
40 | };
|
41 | export type Metadata = {
|
42 | cryptoMetadata?: CryptoMetadata;
|
43 | } & BaseMetadata;
|
44 | declare function readCollation(buf: Buffer, offset: number): Result<Collation>;
|
45 | declare function readMetadata(buf: Buffer, offset: number, options: ParserOptions): Result<Metadata>;
|
46 | declare function metadataParse(parser: Parser, options: ParserOptions, callback: (metadata: Metadata) => void): void;
|
47 | export default metadataParse;
|
48 | export { readCollation, readMetadata };
|