import { PrimaryKeyType } from './glossary' ; export type PrimaryKeyGetter < ValueType extends PrimaryKeyType > = ( ) => ValueType ; export class PrimaryKey < ValueType extends PrimaryKeyType = string > { public getPrimaryKeyValue : PrimaryKeyGetter < ValueType > ; constructor ( getter ) { this . getPrimaryKeyValue = getter ; } } export function primaryKey < ValueType extends PrimaryKeyType > ( getter ) { return new PrimaryKey ( getter ) ; }