Skip to content

Guide for Typescript #96

@wolfcomp

Description

@wolfcomp

Would it be possible to add a typescript guide in the markdown to this for future uses.

Made this based on the README.md documentation should match up with what is written in it

interface CountOptions<T> {
    noReady?: boolean;
    nonReactive?: boolean;
    countFromField?: string | ((doc: T) => any);
    countFromFieldLength?: string | ((doc: T) => any);
    noWarnings?: boolean;
}

declare namespace Counts {
    function get(name: string): number;
    function publish<T>(subscription: Subscription, name: string, cursor: Mongo.Cursor<T, T>, options?: CountOptions<T>): void;
    function has(name: string): boolean;
    function noWarnings(): void;
}

Added this to the root folder in my project as publish-counts-d-ts and seems to work from what VSCode tells me and the fact I had no compile errors or runtime errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions