lineto.d.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { Line } from '../line';
  2. import { Point } from '../point';
  3. import { Segment } from './segment';
  4. export declare class LineTo extends Segment {
  5. constructor(line: Line);
  6. constructor(x: number, y: number);
  7. constructor(p: Point.PointLike | Point.PointData);
  8. get type(): string;
  9. get line(): Line;
  10. bbox(): import("..").Rectangle;
  11. closestPoint(p: Point.PointLike | Point.PointData): Point;
  12. closestPointLength(p: Point.PointLike | Point.PointData): number;
  13. closestPointNormalizedLength(p: Point.PointLike | Point.PointData): number;
  14. closestPointTangent(p: Point.PointLike | Point.PointData): Line | null;
  15. length(): number;
  16. divideAt(ratio: number): [Segment, Segment];
  17. divideAtLength(length: number): [Segment, Segment];
  18. getSubdivisions(): never[];
  19. pointAt(ratio: number): Point;
  20. pointAtLength(length: number): Point;
  21. tangentAt(ratio: number): Line | null;
  22. tangentAtLength(length: number): Line | null;
  23. isDifferentiable(): boolean;
  24. clone(): LineTo;
  25. scale(sx: number, sy: number, origin?: Point.PointLike | Point.PointData): this;
  26. rotate(angle: number, origin?: Point.PointLike | Point.PointData): this;
  27. translate(tx: number, ty: number): this;
  28. translate(p: Point.PointLike | Point.PointData): this;
  29. equals(s: Segment): boolean;
  30. toJSON(): {
  31. type: string;
  32. start: {
  33. x: number;
  34. y: number;
  35. };
  36. end: {
  37. x: number;
  38. y: number;
  39. };
  40. };
  41. serialize(): string;
  42. }
  43. export declare namespace LineTo {
  44. function create(line: Line): LineTo;
  45. function create(point: Point.PointLike): LineTo;
  46. function create(x: number, y: number): LineTo;
  47. function create(point: Point.PointLike, ...points: Point.PointLike[]): LineTo[];
  48. function create(x: number, y: number, ...coords: number[]): LineTo[];
  49. }