import type { TypesaurusCore as Core } from "./types/core.js"; import type { TypesaurusShared as Shared } from "./types/shared.js"; export * from "./types/batch.js"; export * from "./types/core.js"; export * from "./types/firebase.js"; export * from "./types/groups.js"; export * from "./types/helpers.js"; export * from "./types/query.js"; export * from "./types/transaction.js"; export * from "./types/update.js"; export * from "./types/utils.js"; export * from "./helpers/index.js"; export * from "./sp/index.js"; export declare const schema: Core.Function; export declare namespace Typesaurus { /** * The type represents your database structure and provides type shortcuts for * all kinds of data. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#schema) */ type Schema> = Core.InferSchema; /** * Defines a server date. Use it to define a field that will be set to * the server date on creation. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#serverdate) */ type ServerDate = Core.ServerDate; /** * Deeply normalizes server dates in a given type. It replaces ServerDate with * regular Date. It's useful when reusing interfaces in a non-Typesaurus * environment or when you need to store it in an array (where server dates * are not allowed). */ type NormalizeServerDates = Core.NormalizeServerDates; /** * Deeply adds null to all undefined values. It's helpful in wrapping your * types when you expect data from Firestore, where undefined values turn into * nulls. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#nullify) */ type Nullify = Core.Nullify; /** * Narrows doc type. If your doc has a variable model, the type will help you * narrow down the doc type to a specific data type. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#narrowdoc) */ type NarrowDoc, NarrowToModel extends Core.ModelObjectType> = Core.NarrowDoc; /** * Shared ref type. Unlike regular ref, shared ref lacks methods which * type-safety depends on knowing the full type of the model: `set`, `upset`, * and `as`. The `collection` is also limited. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#sharedref) */ type SharedRef = Shared.Ref; /** * Shared doc type. Unlike regular doc, shared doc lacks methods which * type-safety depends on knowing the full type of the model: `set`, `upset`, * and `as`. The `ref` is also limited. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#shareddoc) */ type SharedDoc = Shared.Doc; /** * Shared ref or doc type. Unlike regular ref and doc, shared doc lacks * methods which type-safety depends on knowing the full type of the model: * `set`, `upset`, and `as`. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#sharedentity) */ type SharedEntity = Shared.Ref | Shared.Doc; /** * Shared collection type. Unlike regular collection, shared collection lacks * methods which type-safety depends on knowing the full type of the model: * `add`, `set`, `upset`, and `update`. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#sharedcollection) */ type SharedCollection = Shared.Collection; /** * Shared collection group type. Unlike regular group, shared group lacks * methods which type-safety depends on knowing the full type of the model: * `add`, `set`, `upset`, and `update`. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#sharedgroup) */ type SharedGroup = Shared.Group; /** * Concats models into single variable model type. Useful to define and export * variable models ouside of the centraliazed schema definition. */ type ConcatModel = Core.ConcatModel; /** * The type represents the document id. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#id) * * @deprecated Use `SharedRef` instead. Might be removed in the next major version. */ type Id = Core.Id; /** * The type allows defining collection types. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#collection) * * @deprecated Use `SharedRef` instead. Might be removed in the next major version. */ type Collection = Core.AnyCollection>; /** * The type represents the document reference type. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#ref) * * @deprecated Use `SharedRef` instead. Might be removed in the next major version. */ type Ref = Core.Ref>; /** * The type represents the document type. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#doc) * * @deprecated Use `SharedRef` instead. Might be removed in the next major version. */ type Doc = Core.Doc, Core.DocProps>; /** * The type represents the document data type * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#data) */ type Data = Core.AnyData>>; /** * The type represents the document definition. It's in many methods as * a generic parameter. * * [Learn more on the docs website](https://typesaurus.com/types/typesaurus/#def) */ type Def = { Model: Core.NullifyModel; Name: Name; Id: Id; WideModel: Core.NullifyModel; Flags: Flags; }; }