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