location.ts 664 B

123456789101112131415161718
  1. /**
  2. * Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. import { StructureElement } from './structure'
  7. import { Link } from './structure/structure/unit/links'
  8. import { ShapeGroup } from './shape/shape';
  9. /** A null value Location */
  10. export const NullLocation = { kind: 'null-location' as 'null-location' }
  11. export type NullLocation = typeof NullLocation
  12. export function isNullLocation(x: any): x is NullLocation {
  13. return !!x && x.kind === 'null-location';
  14. }
  15. export type Location = StructureElement | Link.Location | ShapeGroup.Location | NullLocation