Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Interfaces

Functions

Functions

collection

  • collection<Model>(path: string): Collection<Model>
  • Creates a collection object.

    import { add, collection } from 'typesaurus'
    
    type User = { name: string }
    const users = collection<User>('users')
    //=> { __type__: 'collection', path: 'users' }
    
    add(users, { name: 'Sasha' })

    Type parameters

    • Model

    Parameters

    • path: string

      The collection path

    Returns Collection<Model>

    The collection object

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc