Nearsighted Penguin March

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

    0.8.2 • Public • Published

    Installation

    npm install --save @types/falcor-router

    Summary

    This package contains type definitions for falcor-router (https://github.com/Netflix/falcor-router).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/falcor-router.

    index.d.ts

    // Type definitions for falcor-router 0.8
    // Project: https://github.com/Netflix/falcor-router
    // Definitions by: Quramy <https://github.com/Quramy>
    //                 cdhgee <https://github.com/cdhgee>
    //                 LukeRielley <https://github.com/lukerielley>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    // TypeScript Version: 2.4
    
    /// <reference types="falcor" />
    import * as FalcorModel from 'falcor';
    import * as FalcorJsonGraph from 'falcor-json-graph';
    import DataSource = FalcorModel.DataSource;
    import { Observable } from 'rx';
    
    declare class FalcorRouter extends DataSource {
    
        constructor(routes: Array<FalcorRouter.RouteDefinition>, options?: FalcorRouter.RouterOptions);
    
        /**
         * When a route misses on a call, get, or set the unhandledDataSource will
         * have a chance to fulfill that request.
         **/
        routeUnhandledPathsTo(dataSource: DataSource): void;
    
        static createClass(routes?: Array<FalcorRouter.RouteDefinition>): typeof FalcorRouter.CreatedRouter;
    }
    
    declare namespace FalcorRouter {
    
        class CreatedRouter extends FalcorRouter {
            constructor(options?: RouterOptions);
        }
    
        interface Route {
            route: string;
        }
    
        type RoutePathSet = FalcorJsonGraph.PathSet;
    
        interface CallRoute extends Route {
            call(callPath: RoutePathSet, args: Array<any>): CallRouteResult | Promise<CallRouteResult> | Observable<CallRouteResult>;
        }
    
        interface GetRoute extends Route {
            get(pathset: RoutePathSet): RouteResult | Promise<RouteResult> | Observable<RouteResult>;
        }
    
        interface SetRoute extends Route {
            set(jsonGraph: FalcorJsonGraph.JSONGraph): RouteResult | Promise<RouteResult> | Observable<RouteResult>;
        }
    
        type RouteDefinition = GetRoute | SetRoute | CallRoute;
        type RouteResult = FalcorJsonGraph.PathValue | Array<FalcorJsonGraph.PathValue> | FalcorJsonGraph.JSONEnvelope<any>;
        type CallRouteResult = FalcorJsonGraph.PathValue | FalcorJsonGraph.InvalidPath | Array<FalcorJsonGraph.PathValue | FalcorJsonGraph.InvalidPath> | FalcorJsonGraph.JSONGraphEnvelope;
    
        interface RouterOptions {
            debug?: boolean | undefined;
            maxPaths?: number | undefined;
            maxRefFollow?: number | undefined;
        }
    }
    
    export = FalcorRouter;
    

    Additional Details

    Credits

    These definitions were written by Quramy, cdhgee, and LukeRielley.

    Keywords

    none

    Install

    npm i @types/falcor-router

    DownloadsWeekly Downloads

    3

    Version

    0.8.2

    License

    MIT

    Unpacked Size

    7.81 kB

    Total Files

    4

    Last publish

    Collaborators

    • types