segment.d.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { Geometry } from '../geometry';
  2. import { Line } from '../line';
  3. import { Point } from '../point';
  4. import { Rectangle } from '../rectangle';
  5. export declare abstract class Segment extends Geometry {
  6. isVisible: boolean;
  7. isSegment: boolean;
  8. isSubpathStart: boolean;
  9. nextSegment: Segment | null;
  10. previousSegment: Segment | null;
  11. subpathStartSegment: Segment | null;
  12. protected endPoint: Point;
  13. get end(): Point;
  14. get start(): Point;
  15. abstract get type(): string;
  16. abstract bbox(): Rectangle | null;
  17. abstract closestPoint(p: Point.PointLike | Point.PointData): Point;
  18. abstract closestPointLength(p: Point.PointLike | Point.PointData): number;
  19. abstract closestPointNormalizedLength(p: Point.PointLike | Point.PointData): number;
  20. closestPointT(p: Point.PointLike | Point.PointData, options?: Segment.Options): number;
  21. abstract closestPointTangent(p: Point.PointLike | Point.PointData): Line | null;
  22. abstract length(options?: Segment.Options): number;
  23. lengthAtT(t: number, options?: Segment.Options): number;
  24. abstract divideAt(ratio: number, options?: Segment.Options): [Segment, Segment];
  25. abstract divideAtLength(length: number, options?: Segment.Options): [Segment, Segment];
  26. divideAtT(t: number): [Segment, Segment];
  27. abstract getSubdivisions(options?: Segment.Options): Segment[];
  28. abstract pointAt(ratio: number): Point;
  29. abstract pointAtLength(length: number, options?: Segment.Options): Point;
  30. pointAtT(t: number): Point;
  31. abstract tangentAt(ratio: number): Line | null;
  32. abstract tangentAtLength(length: number, options?: Segment.Options): Line | null;
  33. tangentAtT(t: number): Line | null;
  34. abstract isDifferentiable(): boolean;
  35. abstract clone(): Segment;
  36. }
  37. export declare namespace Segment {
  38. interface Options {
  39. precision?: number;
  40. subdivisions?: Segment[];
  41. }
  42. }