Polygon.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import type { DisplayObjectConfig } from '../dom';
  2. import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
  3. import { DisplayObject } from './DisplayObject';
  4. export interface PolygonStyleProps extends BaseStyleProps {
  5. points: [number, number][];
  6. /**
  7. * marker will be positioned at the first point
  8. */
  9. markerStart?: DisplayObject;
  10. /**
  11. * marker will be positioned at the last point
  12. */
  13. markerEnd?: DisplayObject;
  14. markerMid?: DisplayObject;
  15. /**
  16. * offset relative to original position
  17. */
  18. markerStartOffset?: number;
  19. /**
  20. * offset relative to original position
  21. */
  22. markerEndOffset?: number;
  23. isClosed?: boolean;
  24. }
  25. export interface ParsedPolygonStyleProps extends ParsedBaseStyleProps {
  26. points: {
  27. points: [number, number][];
  28. segments: [number, number][];
  29. totalLength: number;
  30. };
  31. markerStart?: DisplayObject;
  32. markerMid?: DisplayObject;
  33. markerEnd?: DisplayObject;
  34. markerStartOffset?: number;
  35. markerEndOffset?: number;
  36. isClosed?: boolean;
  37. }
  38. export declare class Polygon extends DisplayObject<PolygonStyleProps, ParsedPolygonStyleProps> {
  39. private markerStartAngle;
  40. private markerEndAngle;
  41. /**
  42. * markers placed at the mid
  43. */
  44. private markerMidList;
  45. constructor({ style, ...rest }?: DisplayObjectConfig<PolygonStyleProps>);
  46. attributeChangedCallback<Key extends keyof PolygonStyleProps>(attrName: Key, oldValue: PolygonStyleProps[Key], newValue: PolygonStyleProps[Key], prevParsedValue: ParsedPolygonStyleProps[Key], newParsedValue: ParsedPolygonStyleProps[Key]): void;
  47. private transformMarker;
  48. private placeMarkerMid;
  49. }
  50. //# sourceMappingURL=Polygon.d.ts.map