@types/xmlpoke
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

Installation

npm install --save @types/xmlpoke

Summary

This package contains type definitions for xmlpoke (https://github.com/mikeobrien/node-xmlpoke).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xmlpoke.

index.d.ts

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

declare namespace XmlPoke { // ghost module
    interface Transform {
        (node: Node, value: string): Value;
    }
    type Value = string | boolean | number | XmlValue | CDataValue | PathToValueMap | Transform;
    type PathToValueMap = {
        [xpath: string]: Value;
    };
    interface API {
        add(xpath: string, value: Value): API;
        add(map: PathToValueMap): API;
        set(xpath: string, value: Value): API;
        set(map: PathToValueMap): API;
        setOrAdd(xpath: string, value: Value): API;
        setOrAdd(map: PathToValueMap): API;
        remove(xpath: string): API;
        clear(xpath: string): API;
        withBasePath(xpath: string): API;
        addNamespace(prefix: string, uri: string): API;
        errorOnNoMatches(): API;
        ensure(xpath: string): API;
    }
    interface CDataValue {
        value: string;
    }
    interface XmlValue {
        value: string;
    }
}

declare module "xmlpoke" {
    const xmlpoke: {
        (xml: string, modify: (api: XmlPoke.API) => void): string;
        CDataValue: new(value: string) => XmlPoke.CDataValue;
        XmlString: new(value: string) => XmlPoke.XmlValue;
    };
    namespace xmlpoke {}
    export = xmlpoke;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Garth Kidd.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/xmlpoke

Weekly Downloads

160

Version

0.1.9

License

MIT

Unpacked Size

5.1 kB

Total Files

5

Last publish

Collaborators

  • types