智慧水务管理系统 - 精河县供水工程综合管理平台

index.d.ts 3.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. export default class KDBush {
  2. /**
  3. * Creates an index from raw `ArrayBuffer` data.
  4. * @param {ArrayBufferLike} data
  5. */
  6. static from(data: ArrayBufferLike): KDBush;
  7. /**
  8. * Creates an index that will hold a given number of items.
  9. * @param {number} numItems
  10. * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).
  11. * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
  12. * @param {ArrayBufferConstructor | SharedArrayBufferConstructor} [ArrayBufferType=ArrayBuffer] The array buffer type used for storage (`ArrayBuffer` by default).
  13. * @param {ArrayBufferLike} [data] (For internal use only)
  14. */
  15. constructor(numItems: number, nodeSize?: number, ArrayType?: TypedArrayConstructor, ArrayBufferType?: ArrayBufferConstructor | SharedArrayBufferConstructor, data?: ArrayBufferLike);
  16. numItems: number;
  17. nodeSize: number;
  18. ArrayType: TypedArrayConstructor;
  19. IndexArrayType: Uint16ArrayConstructor | Uint32ArrayConstructor;
  20. data: ArrayBufferLike;
  21. ids: Uint16Array<ArrayBuffer> | Uint32Array<ArrayBuffer>;
  22. coords: Int8Array<ArrayBuffer> | Uint8Array<ArrayBuffer> | Uint8ClampedArray<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float32Array<ArrayBuffer> | Float64Array<ArrayBuffer>;
  23. _pos: number;
  24. _finished: boolean;
  25. /**
  26. * Add a point to the index.
  27. * @param {number} x
  28. * @param {number} y
  29. * @returns {number} An incremental index associated with the added item (starting from `0`).
  30. */
  31. add(x: number, y: number): number;
  32. /**
  33. * Perform indexing of the added points.
  34. */
  35. finish(): this;
  36. /**
  37. * Search the index for items within a given bounding box.
  38. * @param {number} minX
  39. * @param {number} minY
  40. * @param {number} maxX
  41. * @param {number} maxY
  42. * @returns {number[]} An array of indices correponding to the found items.
  43. */
  44. range(minX: number, minY: number, maxX: number, maxY: number): number[];
  45. /**
  46. * Search the index for items within a given radius.
  47. * @param {number} qx
  48. * @param {number} qy
  49. * @param {number} r Query radius.
  50. * @returns {number[]} An array of indices correponding to the found items.
  51. */
  52. within(qx: number, qy: number, r: number): number[];
  53. /**
  54. * Search the index for items within a given radius, writing matching ids into `out`
  55. * via indexed assignment (`out[i] = id`). Accepts any indexed-writable container —
  56. * a typed array sized to the expected upper bound (allocation-free, fast) or a plain
  57. * `Array` (which will grow as needed). Returns the number of matches written.
  58. * @param {number} qx
  59. * @param {number} qy
  60. * @param {number} r Query radius.
  61. * @param {number[] | TypedArray} out Container to write matching ids into.
  62. * @returns {number} The number of matches written to `out`.
  63. */
  64. withinInto(qx: number, qy: number, r: number, out: number[] | TypedArray): number;
  65. }
  66. export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
  67. export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;