<commit_before>/// <reference types="node" />

import { EventEmitter } from "events";
import { frames } from "./frames";
import { EndpointState } from "./endpoint";
import { Delivery, Session } from "./session";
import { EventContext, Message, TerminusOptions, Connection, LinkOptions, Source, AmqpError, Dictionary } from "./connection";

export declare interface FlowController {
  window: number;
  update(context: EventContext): void;
}

export declare interface LinkError extends Error {
  message: string;
  condition: any;
  link: link;
}

export declare interface link extends EventEmitter {
  init(session: Session, name: string, local_handle: any, opts: any, is_receiver: boolean): void;
  session: Session;
  connection: Connection;
  name: string;
  options: LinkOptions;
  readonly error: AmqpError | Error;
  readonly snd_settle_mode: 0 | 1 | 2;
  readonly rcv_settle_mode: 0 | 1;
  readonly source: Source;
  readonly target: TerminusOptions;
  readonly max_message_size: number;
  readonly offered_capabilities: string | string[];
  readonly desired_capabilities: string | string[];
  readonly properties: Dictionary<any>;
  set_source(fields: Source): void;
  set_target(fields: TerminusOptions): void;
  attach(): void;
  open(): void;
  detach(): void;
  close(error?: AmqpError): void;
  remove(): void;
  is_open(): boolean;
  is_remote_open(): boolean;<commit_msg>error is optional for link<commit_after>/// <reference types="node" />

import { EventEmitter } from "events";
import { frames } from "./frames";
import { EndpointState } from "./endpoint";
import { Delivery, Session } from "./session";
import { EventContext, Message, TerminusOptions, Connection, LinkOptions, Source, AmqpError, Dictionary } from "./connection";

export declare interface FlowController {
  window: number;
  update(context: EventContext): void;
}

export declare interface LinkError extends Error {
  message: string;
  condition: any;
  link: link;
}

export declare interface link extends EventEmitter {
  init(session: Session, name: string, local_handle: any, opts: any, is_receiver: boolean): void;
  session: Session;
  connection: Connection;
  name: string;
  options: LinkOptions;
  readonly error?: AmqpError | Error;
  readonly snd_settle_mode: 0 | 1 | 2;
  readonly rcv_settle_mode: 0 | 1;
  readonly source: Source;
  readonly target: TerminusOptions;
  readonly max_message_size: number;
  readonly offered_capabilities: string | string[];
  readonly desired_capabilities: string | string[];
  readonly properties: Dictionary<any>;
  set_source(fields: Source): void;
  set_target(fields: TerminusOptions): void;
  attach(): void;
  open(): void;
  detach(): void;
  close(error?: AmqpError): void;
  remove(): void;
  is_open(): boolean;
  is_remote_open(): boolean;
{'fraction_non_alphanumeric': 0.11665470208183776, 'fraction_numerical': 0.003589375448671931, 'mean_word_length': 5.152317880794702, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1828779', 'n_tokens_mistral': 803, 'n_tokens_neox': 797, 'n_words': 265}