UNPKG

489 BTypeScriptView Raw
1/** @module data */
2/**
3 * Generic interface for data objects that can be uniquely identified by an id.
4 *
5 * The type specified in the interface defines the type of id field.
6 *
7 * ### Example ###
8 *
9 * export class MyData implements IIdentifiable<string> {
10 * public id: string;
11 * public field1: string;
12 * public field2: number;
13 * ...
14 * }
15 */
16export interface IIdentifiable<K> {
17 /** The unique object identifier of type K. */
18 id: K;
19}