2018-11-07 08:43:48 +01:00
|
|
|
/**
|
|
|
|
* One can navigate to the detail page of every object implementing this interface.
|
|
|
|
*/
|
|
|
|
export interface DetailNavigable {
|
|
|
|
/**
|
|
|
|
* Get the url for the detail view, so the user can navigate to it.
|
|
|
|
*/
|
|
|
|
getDetailStateURL(): string;
|
|
|
|
}
|
2019-02-01 10:59:58 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* check if a given object implements implements this interface
|
|
|
|
*
|
|
|
|
* @param obj
|
|
|
|
* @returns true if the interface is implemented
|
|
|
|
*/
|
|
|
|
export function isDetailNavigable(obj: object): obj is DetailNavigable {
|
|
|
|
return (<DetailNavigable>obj).getDetailStateURL !== undefined;
|
|
|
|
}
|