Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Interfaces

Functions

Functions

doc

  • doc<Model>(ref: Ref<Model>, data: Model): Doc<Model>
  • Creates a document object.

    import { doc, ref, collection } from 'typesaurus'
    
    type User = { name: string }
    const users = collection<User>('users')
    
    doc(ref(users, '00sHm46UWKObv2W7XK9e'), { name: 'Sasha' })
    //=> {
    //=>   __type__: 'doc',
    //=>   data: { name: 'Sasha' },
    //=>   ref: {,
    //=>      __type__: 'ref'
    //=>     collection: { __type__: 'collection', path: 'users' },
    //=>     id: '00sHm46UWKObv2W7XK9e'
    //=>   }
    //=> }

    Type parameters

    • Model

    Parameters

    • ref: Ref<Model>

      The document reference

    • data: Model

      The model data

    Returns Doc<Model>

    The document 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