@dolittle/sdk.artifacts
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
33 lines • 1.22 kB
TypeScript
import { Guid, IEquatable } from '@dolittle/rudiments';
import { Generation } from './Generation';
/**
* Defines the types that can be used as artifact identifiers.
*/
export declare type ArtifactIdLike = {
value: Guid;
};
/**
* Represents the base representation of an Artifact.
* @template TId The artifact identifier type.
*/
export declare abstract class Artifact<TId extends ArtifactIdLike> implements IEquatable {
readonly id: TId;
readonly generation: Generation;
/**
* Initializes a new instance of {@link EventType}.
* @param {TId} id - The unique identifier of the artifact.
* @param {Generation} [generation] - Optional generation - will default to {@link generation.first}.
*/
constructor(id: TId, generation?: Generation);
/** @inheritdoc */
equals(other: any): boolean;
/** @inheritdoc */
abstract toString(): string;
}
/**
* Checks whether or not an object is an instance of {@link Artifact}.
* @param {any} object - The object to check.
* @returns {boolean} True if the object is an {@link Artifact}, false if not.
*/
export declare const isArtifact: (object: any) => object is Artifact<ArtifactIdLike>;
//# sourceMappingURL=Artifact.d.ts.map