UNPKG

@dolittle/sdk.artifacts

Version:

Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.

26 lines 1.2 kB
import { ConceptAs } from '@dolittle/concepts'; import { Guid } from '@dolittle/rudiments'; import { Constructor } from '@dolittle/types'; import { Artifact } from './Artifact'; import { IArtifacts, ArtifactOrId } from './IArtifacts'; import { TypeMap } from './Mappings/TypeMap'; /** * Represents an implementation of {@link IArtifacts}. * @template TArtifact The artifact type to map to a type. * @template TId The id type of the artifact. */ export declare abstract class Artifacts<TArtifact extends Artifact<TId>, TId extends ConceptAs<Guid, string>> extends TypeMap<TArtifact, [string, number]> implements IArtifacts<TArtifact, TId> { /** * Initialises a new instance of the {@link Artifacts} class. * @param {Constructor} artifactType - The type of the artifact. */ constructor(artifactType: Constructor<TArtifact>); /** @inheritdoc */ resolveFrom(object: any, input?: ArtifactOrId<TArtifact, TId>): TArtifact; /** * Creates an artifact from an id. * @param {TId | Guid | string} id - The artifact id to create from. */ protected abstract createArtifactFrom(id: TId | Guid | string): TArtifact; } //# sourceMappingURL=Artifacts.d.ts.map