mirror of
https://github.com/parnic/node-intellicenter.git
synced 2025-06-16 10:10:13 -05:00
This allows require() and import to work for even better compatibility between CJS and ESM consumers. I dislike that this kills our ability for top-level awaits in example.ts, but seeing as how my primary use case for this library is a commonjs module, I think this is a fair trade-off. Also changed "messages" to not encapsulate its export under the name "messages" to remove some repetition in importing "messages" and still needing to do "messages." to get the methods out. Now it's simple to import each message by name or group them under something like "messages" as desired on a per-library-user basis. Refs: * https://www.kravchyk.com/typescript-npm-package-json-exports/ * https://arethetypeswrong.github.io/ * https://evertpot.com/universal-commonjs-esm-typescript-packages/
36 lines
972 B
TypeScript
36 lines
972 B
TypeScript
export declare const TypeTxt = 16;
|
|
export declare const TypePtr = 12;
|
|
export declare const TypeSrv = 33;
|
|
export declare const TypeA = 1;
|
|
export declare class Question {
|
|
name: string;
|
|
type: number;
|
|
class: number;
|
|
endOffset: number;
|
|
}
|
|
export declare abstract class Record {
|
|
type: number;
|
|
ttlSeconds: number;
|
|
name: string;
|
|
endOffset: number;
|
|
}
|
|
export declare class PtrRecord extends Record {
|
|
domain: string;
|
|
}
|
|
export declare class TxtRecord extends Record {
|
|
text: string;
|
|
}
|
|
export declare class SrvRecord extends Record {
|
|
priority: number;
|
|
weight: number;
|
|
port: number;
|
|
target: string;
|
|
}
|
|
export declare class ARecord extends Record {
|
|
address: number;
|
|
get addressStr(): string;
|
|
}
|
|
export declare function ipToString(ip: number): string;
|
|
export declare function GetDNSQuestion(msg: Buffer, startOffset: number): Question;
|
|
export declare function GetDNSAnswer(msg: Buffer, startOffset: number): Record | undefined;
|