UNPKG

711 BTypeScriptView Raw
1/** @module data */
2import { IIdentifiable } from './IIdentifiable';
3/**
4 * Interface for data objects that can be uniquely identifed by a string id.
5 *
6 * The interface extends [[IIdentifiable]] to hardcode id type to string.
7 *
8 * It is a common pattern to use a string GUID as the id, generated by [[IdGenerator]].
9 *
10 * @see [[IIdentifiable]]
11 * @see [[IdGenerator]]
12 *
13 * ### Example ###
14 *
15 * export class MyData implements IStringIdentifiable {
16 * public id: string;
17 * public field1: string;
18 * public field2: number;
19 * ...
20 * }
21 */
22export interface IStringIdentifiable extends IIdentifiable<string> {
23 /** The object's unique string id. */
24 id: string;
25}