import * as miniseed from "./miniseed.mjs"; import * as mseed3 from "./mseed3.mjs"; import { DataRecord } from "./miniseed.mjs"; import { MSeed3Record } from "./mseed3.mjs"; import { DateTime } from "luxon"; export declare const SEEDLINK4_SLPROTO = "SLPROTO"; export declare const SEEDLINK4_PROTOCOL = "SLPROTO:4.0"; export declare const WS_SEEDLINK4_SUBPROTOCOL = "SeedLink4.0"; export declare const MINISEED_2_FORMAT = "2"; export declare const MINISEED_3_FORMAT = "3"; export declare const SE_PACKET_SIGNATURE = "SE"; export declare const END_COMMAND = "END"; export declare const ENDFETCH_COMMAND = "ENDFETCH"; export declare const AUTH_COMMAND = "AUTH"; export declare const BYE_COMMAND = "BYE"; export declare const DATA_COMMAND = "DATA"; export declare const HELLO_COMMAND = "HELLO"; export declare const INFO_COMMAND = "INFO"; export declare const SELECT_COMMAND = "SELECT"; export declare const SLPROTO_COMMAND = "SLPROTO"; export declare const STATION_COMMAND = "STATION"; export declare const USERAGENT_COMMAND = "USERAGENT"; export declare const SL_OK = "OK"; export declare class SEPacket { dataFormat: string; dataSubformat: string; payloadLength: number; sequence: bigint; stationId: string; _miniseed: DataRecord | null; _mseed3: MSeed3Record | null; _json: Record | null; _rawPayload: DataView | null; constructor(dataFormat: string, dataSubformat: string, payloadLength: number, sequence: bigint, stationId: string); static parse(data: ArrayBufferLike): SEPacket; /** * is this packet a miniseed packet * * @returns true if it is miniseed */ isMiniseed(): boolean; /** * Parsed payload as a miniseed data record, if the streamid * ends with '/MSEED', null otherwise. * * @returns miniseed DataRecord or null */ asMiniseed(): miniseed.DataRecord | null; /** * is this packet a miniseed3 packet * * @returns true if it is miniseed3 */ isMiniseed3(): boolean; /** * Parsed payload as a miniseed3 data record, if the data format is 3, null otherwise. * * @returns miniseed3 DataRecord or null */ asMiniseed3(): mseed3.MSeed3Record | null; } export declare function createDataTimeCommand(startTime: DateTime, endTime?: DateTime): string; /** * A seedlink websocket connection to the given url. * The connection is not made until the connect() method is called. * Note this cannot connect directly to a native TCP socket, instead it * sends the seedlink protocol over a websocket. Currently only the IRIS * ringserver, https://github.com/iris-edu/ringserver, * supports websockets, but it may be possible to use third party * tools to proxy the websocket to a TCP seedlink socket. * * The spec is available via the FDSN, https://www.fdsn.org/publications/ * * * @param url websocket URL to connect to * @param requestConfig an array of seedlink commands * like:

 *   [ 'STATION CO_JSC',
 *     'SELECT 00_B_H_Z' ]
 *     
* @param receivePacketFn the callback function that * will be invoked for each seedlink packet received. * @param errorHandler callback function for errors * @param closeFn callback function for closing connection * @param webSocket optional web socket connection * @param endCommand handshake ending command, either END or ENDFETCH * @param agent agent identifier * @param agentVersion agent version */ export declare class SeedlinkConnection { url: string; requestConfig: Array; receivePacketFn: (packet: SEPacket) => void; errorHandler: (error: Error) => void; logCommandFn: null | ((cmd: string) => void); closeFn: null | ((close: CloseEvent) => void); webSocket: null | WebSocket; subprotocol: string | Array; endCommand: string; agent: string; agentVersion: string; constructor(url: string, requestConfig: Array, receivePacketFn: (packet: SEPacket) => void, errorHandler: (error: Error) => void); setAgent(agent: string): void; setOnError(errorHandler: (error: Error) => void): void; setOnClose(closeFn: (close: CloseEvent) => void): void; connect(): Promise; interactiveConnect(): Promise; checkProto(lines: Array): boolean; close(): void; handle(event: MessageEvent): void; handleSEPacket(event: MessageEvent): void; isConnected(): boolean; /** * Sends initial HELLO to server and waits for response. * * @returns Promise that resolves to the response from the server. */ sendHello(): Promise>; sendSLProto(version: string): Promise; /** * Sends an array of commands, each as a Promise waiting for the 'OK' response * before sending the next. * * @param cmd array of commands to send * @returns Promise that resolves to the 'OK' returned by the last * command if successful, or rejects on the first failure. */ sendCmdArray(cmd: Array): Promise; /** * creates a Promise that sends a command and waits resolved with the result. * * @param mycmd command string to send. * @returns Promise that resolves to the reply from the server. */ createCmdPromise(mycmd: string): Promise; /** * handle errors that arise * * @private * @param error the error */ handleError(error: Error): void; } //# sourceMappingURL=seedlink4.d.mts.map