SVGLoader.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {
  2. Loader,
  3. LoadingManager,
  4. ShapePath,
  5. BufferGeometry,
  6. Vector3
  7. } from '../../../src/Three';
  8. interface SVGResultPaths extends ShapePath {
  9. userData?: {
  10. [key: string]: any
  11. }
  12. }
  13. export interface SVGResult {
  14. paths: SVGResultPaths[];
  15. xml: XMLDocument;
  16. }
  17. export interface StrokeStyle {
  18. strokeColor: string;
  19. strokeWidth: number;
  20. strokeLineJoin: string;
  21. strokeLineCap: string;
  22. strokeMiterLimit: number;
  23. }
  24. export class SVGLoader extends Loader {
  25. constructor( manager?: LoadingManager );
  26. defaultDPI: number;
  27. defaultUnit: string;
  28. load( url: string, onLoad: ( data: SVGResult ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
  29. loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<SVGResult>;
  30. parse( text: string ) : SVGResult;
  31. static getStrokeStyle( width?: number, color?: string, lineJoin?: string, lineCap?: string, miterLimit?: number ): StrokeStyle;
  32. static pointsToStroke( points: Vector3[], style: StrokeStyle, arcDivisions?: number, minDistance?: number ): BufferGeometry;
  33. static pointsToStrokeWithBuffers( points: Vector3[], style: StrokeStyle, arcDivisions?: number, minDistance?: number, vertices?: number[], normals?: number[], uvs?: number[], vertexOffset?: number ): number;
  34. }