@dolittle/sdk.projections
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
37 lines • 1.56 kB
TypeScript
import { ConceptAs } from '@dolittle/concepts';
/**
* Defines the types that can be converted into a {@link CollectionName}.
*/
export declare type CollectionNameLike = string | CollectionName;
/**
* Represents the name of a Collection in MongoDB.
*/
export declare class CollectionName extends ConceptAs<string, '@dolittle/sdk.projections.Copies.MongoDB.CollectionName'> {
/**
* Initialises a new instance of the {@link CollectionName} class.
* @param {string} name - The name of the collection.
*/
constructor(name: string);
/**
* Checks if the collection name is considered a valid MongoDB collection name.
* @returns {[true] | [false, Error]} A value indicating whether or not the collection name is valid, and potentially an error describing why not.
*/
isValid(): [true] | [false, Error];
/**
* Gets the not set collection name.
*/
static get notSet(): CollectionName;
/**
* Creates a {@link CollectionName} from a {@link string}.
* @param {CollectionNameLike} name - The name of the collection.
* @returns {CollectionName} The created collection name concept.
*/
static from(name: CollectionNameLike): CollectionName;
}
/**
* Checks whether or not an object is an instance of {@link CollectionName}.
* @param {any} object - The object to check.
* @returns {boolean} True if the object is an {@link CollectionName}, false if not.
*/
export declare const isCollectionName: (object: any) => object is CollectionName;
//# sourceMappingURL=CollectionName.d.ts.map