Nonconformist Propaganda Machine

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

    2.1.4 • Public • Published

    Installation

    npm install --save @types/lucene

    Summary

    This package contains type definitions for lucene (https://github.com/bripkens/lucene#readme).

    Details

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

    index.d.ts

    // Type definitions for lucene 2.1
    // Project: https://github.com/bripkens/lucene#readme
    // Definitions by: Ben Grynhaus <https://github.com/bengry>
    //                 Hugo Muller <https://github.com/HugoMuller>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    export interface TermLocation {
        column: number;
        line: number;
        offset: number;
    }
    
    export interface NodeField {
        field: string | '<implicit>';
        fieldLocation: null | {
            end: TermLocation;
            start: TermLocation;
        };
    }
    
    export interface NodeTerm extends NodeField {
        boost: null | number;
        prefix: null | string;
        quoted: boolean;
        regex: boolean;
        similarity: null | number;
        term: string;
        termLocation: {
            start: TermLocation;
            end: TermLocation;
        };
    }
    
    export interface NodeRangedTerm extends NodeField {
        inclusive: "both" | "none" | "left" | "right";
        term_max: string;
        term_min: string;
    }
    
    export type Node =
        | NodeTerm
        | NodeRangedTerm
    ;
    
    export type Operator = '<implicit>' | 'NOT' | 'OR' | 'AND' | 'AND NOT' | 'OR NOT';
    
    export interface ASTField {
        field?: string;
        fieldLocation?: null | {
            end: TermLocation;
            start: TermLocation;
        };
        parenthesized?: boolean;
    }
    
    export interface LeftOnlyAST extends ASTField {
        left: AST | Node;
        start?: Operator | undefined;
    }
    
    export interface BinaryAST extends ASTField {
        left: AST | Node;
        operator: Operator;
        right: AST | Node;
    }
    
    export type AST = LeftOnlyAST | BinaryAST;
    
    export function parse(query: string): AST;
    
    export function toString(ast: AST): string;
    
    export interface Parser {
        escape(str: string): string;
        unescape(str: string): string;
    }
    
    export const term: Parser;
    export const phrase: Parser;

    Additional Details

    • Last updated: Mon, 06 Dec 2021 20:31:04 GMT
    • Dependencies: none
    • Global values: none

    Credits

    These definitions were written by Ben Grynhaus, and Hugo Muller.

    Keywords

    none

    Install

    npm i @types/lucene

    DownloadsWeekly Downloads

    2,017

    Version

    2.1.4

    License

    MIT

    Unpacked Size

    6.29 kB

    Total Files

    4

    Last publish

    Collaborators

    • types