Skip to content

Interface: Extension<Id, Ops, Content> ​

Defined in: netconf/src/operations/extension.ts:211

An extension: an optional NETCONF feature enabled per connection with connect({ extensions: [...] }). The library's own (such as monitoring and nmda) are built with defineExtension, as yours can be. See Extensions and Writing your own.

Type Parameters ​

Id ​

Id extends string = string

Ops ​

Ops extends object = object

Content ​

Content extends object = object

Properties ​

augments? ​

ts
readonly augments?: readonly Augment[];

Defined in: netconf/src/operations/extension.ts:248

Parameters this extension adds to base operations.


clientCapabilities? ​

ts
readonly clientCapabilities?: readonly string[];

Defined in: netconf/src/operations/extension.ts:219

Capabilities added to our <hello>.


description? ​

ts
readonly description?: string;

Defined in: netconf/src/operations/extension.ts:215

A one-line summary of what the extension adds, for tools and help text.


descriptors? ​

ts
readonly descriptors?: readonly OperationDescriptor[];

Defined in: netconf/src/operations/extension.ts:238

Descriptors for the RPCs this extension adds (each needs a builder in requests), and for its reads (kind: 'read', run through the method of content they name).


id ​

ts
readonly id: Id;

Defined in: netconf/src/operations/extension.ts:213

Becomes client.ops.<id> and client.content.<id>, for the layers the extension contributes to.


requests? ​

ts
readonly requests?: Readonly<Record<string, RequestBuilder<never>>>;

Defined in: netconf/src/operations/extension.ts:246

Builders for the RPCs in descriptors, by RPC name. Each may type its own arguments ((args: { readonly name: string }) => …): the client calls it only with arguments whose names its descriptor lists, so give the descriptor required and type to match, and check values a tool could send wrongly.


requires? ​

ts
readonly requires?: readonly string[];

Defined in: netconf/src/operations/extension.ts:217

Capabilities the server must advertise, checked after the hello under capabilityCheck.

Methods ​

content()? ​

ts
content?(ctx): Content;

Defined in: netconf/src/operations/extension.ts:232

Content layer: called once per client, after the hello, with the same context as ops. The result becomes client.content.<id>: calls that hand back decoded, typed data. State shared with ops belongs in a WeakMap keyed by ctx.sessionKey.

Parameters ​

ctx ​

ExtensionContext

Returns ​

Content


ops()? ​

ts
ops?(ctx): Ops;

Defined in: netconf/src/operations/extension.ts:225

Operations layer: called once per client, after the hello. The result becomes client.ops.<id>: calls that send operations and hand back XML, a reply, or a handle on what they started (a subscription, a lock).

Parameters ​

ctx ​

ExtensionContext

Returns ​

Ops

Released under the MIT Licence.