@krazyphish/earth 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,380 @@
1
+ //TODO complete all types
2
+ declare module "cesium" {
3
+ export const createMaterialPropertyDescriptor: (...args: any[]) => any
4
+ export const createPropertyDescriptor: (...args: any[]) => any
5
+ export const getElement: (element: string | Element) => Element
6
+ export const subscribeAndEvaluate: (
7
+ owner: object,
8
+ observablePropertyName: string,
9
+ callback: (...args: any) => any,
10
+ target?: object,
11
+ event?: string
12
+ ) => any
13
+
14
+ export interface Material {
15
+ _uniforms: any
16
+ }
17
+
18
+ export class EllipsoidalOccluder {
19
+ cameraPosition: Cartesian3
20
+ ellipsoid: Ellipsoid
21
+ constructor(ellipsoid: Ellipsoid, cameraPosition: Cartesian3)
22
+ computeHorizonCullingPoint(directionToPoint: Cartesian3, positions: Cartesian3[], result: Cartesian3): Cartesian3
23
+ computeHorizonCullingPointFromRectangle(rectangle: Rectangle, ellipsoid: Ellipsoid, result: Cartesian3): Cartesian3
24
+ computeHorizonCullingPointFromVertices(
25
+ directionToPoint: Cartesian3,
26
+ vertices: number[],
27
+ stride: number,
28
+ center: Cartesian3,
29
+ result: Cartesian3
30
+ ): Cartesian3
31
+ isPointVisible(occlude: Cartesian3): boolean
32
+ isScaledSpacePointVisible(occludeScaledSpacePosition: Cartesian3): boolean
33
+ }
34
+
35
+ export namespace DrawCommand {
36
+ type ConstructorOptions = {
37
+ boundingVolume?: Property | Object
38
+ owner?: Property | Object
39
+ primitiveType?: Property | PrimitiveType
40
+ vertexArray?: Property | VertexArray
41
+ uniformMap?: Property | { [key: string]: () => any }
42
+ modelMatrix?: Property | Matrix4
43
+ shaderProgram?: Property | ShaderProgram
44
+ framebuffer?: Property | Framebuffer
45
+ renderState?: Property | RenderState
46
+ pass?: Property | Pass
47
+ offset?: Property | Number
48
+ count?: Property | Number
49
+ }
50
+ }
51
+ export class DrawCommand {
52
+ constructor(options?: DrawCommand.ConstructorOptions)
53
+ boundingVolume: Property | Object | undefined
54
+ owner: Property | Object | undefined
55
+ primitiveType: Property | PrimitiveType
56
+ vertexArray: Property | VertexArray | undefined
57
+ shaderProgram: Property | ShaderProgram | undefined
58
+ renderState: Property | RenderState | undefined
59
+ uniformMap: Property | any
60
+ pass: Property | Pass | undefined
61
+ modelMatrix: Property | Matrix4 | undefined
62
+ offset: Property | Number | undefined
63
+ count: Property | Number | undefined
64
+ }
65
+
66
+ export class ComputeCommand {
67
+ constructor(options?: any)
68
+ }
69
+
70
+ export namespace ClearCommand {
71
+ type ConstructorOptions = {
72
+ color: Color
73
+ depth: number
74
+ framebuffer?: Framebuffer
75
+ pass: Pass
76
+ }
77
+ }
78
+
79
+ export class ClearCommand {
80
+ constructor(options?: ClearCommand.ConstructorOptions)
81
+ framebuffer?: Framebuffer
82
+ execute(context: Context): void
83
+ }
84
+
85
+ export namespace VertexArray {
86
+ type ConstructorOptions = {
87
+ context?: Property | unknown
88
+ attributes?: Property | unknown
89
+ indexBuffer?: Property | unknown
90
+ }
91
+ type GeometryOptions = {
92
+ context?: Context
93
+ geometry?: Geometry
94
+ attributeLocations?: any
95
+ bufferUsage?: BufferUsage
96
+ interleave?: boolean
97
+ }
98
+ }
99
+ export class VertexArray {
100
+ constructor(options?: VertexArray.ConstructorOptions)
101
+ static fromGeometry(options?: VertexArray.GeometryOptions): VertexArray
102
+ }
103
+
104
+ export namespace RenderState {
105
+ type ConstructorOptions = {}
106
+ }
107
+ export class RenderState {
108
+ constructor(renderState?: RenderState.ConstructorOptions)
109
+ static fromCache(renderState: RenderState): RenderState
110
+ }
111
+
112
+ export class FrameState {
113
+ constructor(context: Context, creditDisplay: CreditDisplay, jobScheduler: JobScheduler)
114
+ context: Context
115
+ mode: SceneMode
116
+ commandList: DrawCommand[]
117
+ frameNumber: Number
118
+ time: JulianDate
119
+ passes: {
120
+ render: boolean
121
+ pick: boolean
122
+ depth: boolean
123
+ postProcess: boolean
124
+ offscreen: boolean
125
+ }
126
+ }
127
+
128
+ export enum JobType {
129
+ TEXTURE = 0,
130
+ PROGRAM = 1,
131
+ BUFFER = 2,
132
+ NUMBER_OF_JOB_TYPES = 3,
133
+ }
134
+
135
+ export class JobScheduler {
136
+ constructor(budgets: JobBudget[])
137
+ totalBudget: number
138
+ disableThisFrame(): void
139
+ resetBudgets(): void
140
+ execute(job: { execute: () => void }, jobType: JobType): boolean
141
+ }
142
+
143
+ export class JobBudget {
144
+ constructor(total: number)
145
+ total: number
146
+ usedThisFrame: number
147
+ stolenFromMeThisFrame: number
148
+ starvedThisFrame: boolean
149
+ starvedLastFrame: boolean
150
+ }
151
+
152
+ export namespace Buffer {
153
+ type CreateIndexBufferOptions = {
154
+ context: Context
155
+ typedArray?: ArrayBufferView
156
+ sizeInBytes?: number
157
+ usage: BufferUsage
158
+ indexDatatype: number
159
+ }
160
+ type CreateVertexBufferOptions = {
161
+ context: Context
162
+ typedArray?: ArrayBufferView
163
+ sizeInBytes?: number
164
+ usage: BufferUsage
165
+ }
166
+ type ConstructorOptions = {
167
+ context: Context
168
+ bufferTarget: number
169
+ typedArray?: ArrayBufferView
170
+ sizeInBytes?: number
171
+ usage: BufferUsage
172
+ }
173
+ }
174
+
175
+ export class Buffer {
176
+ constructor(options: Buffer.ConstructorOptions)
177
+ sizeInBytes: number
178
+ usage: BufferUsage
179
+ isDestroyed(): boolean
180
+ destroy(): void
181
+ static createVertexBuffer(options: Buffer.CreateVertexBufferOptions): Buffer
182
+ static createIndexBuffer(options: Buffer.CreateVertexBufferOptions): Buffer
183
+ }
184
+
185
+ export namespace BufferUsage {
186
+ export const validate: (bufferUsage: WebGLConstants) => boolean
187
+ }
188
+
189
+ export enum BufferUsage {
190
+ STREAM_DRAW = WebGLConstants.STREAM_DRAW,
191
+ STATIC_DRAW = WebGLConstants.STATIC_DRAW,
192
+ DYNAMIC_DRAW = WebGLConstants.DYNAMIC_DRAW,
193
+ }
194
+
195
+ export namespace ShaderSource {
196
+ type ConstructorOptions = {
197
+ sources?: string[]
198
+ defines?: string[]
199
+ pickColorQualifier?: string
200
+ includeBuiltIns?: boolean
201
+ }
202
+ }
203
+ export class ShaderSource {
204
+ constructor(options: ShaderSource.ConstructorOptions)
205
+ }
206
+
207
+ export namespace ShaderProgram {
208
+ type CacheOptions = {
209
+ context: Context
210
+ shaderProgram?: ShaderProgram
211
+ vertexShaderSource?: string | ShaderSource
212
+ fragmentShaderSource?: string | ShaderSource
213
+ attributeLocations?: { [key: string]: any }
214
+ }
215
+ }
216
+ export class ShaderProgram {
217
+ destroy(): undefined
218
+ static replaceCache(options: ShaderProgram.CacheOptions): ShaderProgram
219
+ static fromCache(options: ShaderProgram.CacheOptions): ShaderProgram
220
+ }
221
+
222
+ export enum Pass {
223
+ ENVIRONMENT = 0,
224
+ COMPUTE = 1,
225
+ GLOBE = 2,
226
+ TERRAIN_CLASSIFICATION = 3,
227
+ CESIUM_3D_TILE = 4,
228
+ CESIUM_3D_TILE_CLASSIFICATION = 5,
229
+ CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW = 6,
230
+ OPAQUE = 7,
231
+ TRANSLUCENT = 8,
232
+ OVERLAY = 9,
233
+ NUMBER_OF_PASSES = 10,
234
+ }
235
+
236
+ export class Framebuffer {
237
+ constructor(options: any)
238
+ getColorTexture(param: any): any
239
+ depthTexture: any
240
+ destroy(): undefined
241
+ }
242
+
243
+ export class Texture {
244
+ constructor(options: any)
245
+ destroy(): undefined
246
+ }
247
+ export class Sampler {
248
+ constructor(options: any)
249
+ }
250
+
251
+ export namespace Context {
252
+ type WebglOptions = {
253
+ alpha: boolean
254
+ depth: boolean
255
+ stencil: boolean
256
+ antialias: boolean
257
+ premultipliedAlpha: boolean
258
+ preserveDrawingBuffer: boolean
259
+ failIfMajorPerformanceCaveat: boolean
260
+ }
261
+ type ConstructorOptions = {
262
+ allowTextureFilterAnisotropic?: boolean
263
+ requestWebgl2?: boolean
264
+ webgl?: WebglOptions
265
+ getWebGLStub?: (
266
+ canvas: HTMLCanvasElement,
267
+ options: WebglOptions
268
+ ) => CanvasRenderingContext2D | WebGLRenderingContext
269
+ }
270
+ }
271
+ export class Context {
272
+ constructor(canvas: HTMLCanvasElement, options: Context.ConstructorOptions)
273
+ drawingBufferWidth: number
274
+ drawingBufferHeight: number
275
+ }
276
+
277
+ export class PolylinePipeline {
278
+ static generateArc(option: { positions: Cartesian3[]; granularity: number }): number[]
279
+ }
280
+
281
+ export class TweenCollection {
282
+ length: number
283
+ constructor()
284
+ /**
285
+ * Creates a tween for animating between two sets of properties. The tween starts animating at the next call to {@link TweenCollection#update}, which
286
+ * is implicit when {@link Viewer} or {@link CesiumWidget} render the scene.
287
+ *
288
+ * @param {object} [options] Object with the following properties:
289
+ * @param {object} options.startObject An object with properties for initial values of the tween. The properties of this object are changed during the tween's animation.
290
+ * @param {object} options.stopObject An object with properties for the final values of the tween.
291
+ * @param {number} options.duration The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops.
292
+ * @param {number} [options.delay=0.0] The delay, in seconds, before the tween starts animating.
293
+ * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animation.
294
+ * @param {TweenCollection.TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame).
295
+ * @param {TweenCollection.TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating.
296
+ * @param {TweenCollection.TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection.
297
+ * @returns {Tween} The tween.
298
+ *
299
+ * @exception {DeveloperError} options.duration must be positive.
300
+ */
301
+ add(tween: any): any
302
+ /**
303
+ * Determines whether this collection contains a given tween.
304
+ *
305
+ * @param {Tween} tween The tween to check for.
306
+ * @returns {boolean} <code>true</code> if this collection contains the tween, <code>false</code> otherwise.
307
+ */
308
+ contains(tween: any): boolean
309
+ /**
310
+ * Updates the tweens in the collection to be at the provide time. When a tween finishes, it is removed
311
+ * from the collection.
312
+ *
313
+ * @param {number} [time=getTimestamp()] The time in seconds. By default tweens are synced to the system clock.
314
+ */
315
+ update(time?: number): void
316
+ /**
317
+ * Removes a tween from the collection.
318
+ * <p>
319
+ * This calls the {@link Tween#cancel} callback if the tween has one.
320
+ * </p>
321
+ *
322
+ * @param {Tween} tween The tween to remove.
323
+ * @returns {boolean} <code>true</code> if the tween was removed; <code>false</code> if the tween was not found in the collection.
324
+ */
325
+ remove(tween: any): void
326
+ /**
327
+ * Removes all tweens from the collection.
328
+ * <p>
329
+ * This calls the {@link Tween#cancel} callback for each tween that has one.
330
+ * </p>
331
+ */
332
+ removeAll(): void
333
+ }
334
+
335
+ export namespace VerticalExaggeration {
336
+ /**
337
+ * Scales a height relative to an offset.
338
+ *
339
+ * @param {number} height The height.
340
+ * @param {number} scale A scalar used to exaggerate the terrain. If the value is 1.0 there will be no effect.
341
+ * @param {number} relativeHeight The height relative to which terrain is exaggerated. If the value is 0.0 terrain will be exaggerated relative to the ellipsoid surface.
342
+ */
343
+ export const getHeight: (height: number, scale: number, relativeHeight: number) => number
344
+ /**
345
+ * Scales a position by exaggeration.
346
+ *
347
+ * @param {Cartesian3} position The position.
348
+ * @param {Ellipsoid} ellipsoid The ellipsoid.
349
+ * @param {number} verticalExaggeration A scalar used to exaggerate the terrain. If the value is 1.0 there will be no effect.
350
+ * @param {number} verticalExaggerationRelativeHeight The height relative to which terrain is exaggerated. If the value is 0.0 terrain will be exaggerated relative to the ellipsoid surface.
351
+ * @param {Cartesian3} [result] The object onto which to store the result.
352
+ */
353
+ export const getPosition: (
354
+ position,
355
+ ellipsoid,
356
+ verticalExaggeration,
357
+ verticalExaggerationRelativeHeight,
358
+ result
359
+ ) => Cartesian3
360
+ }
361
+
362
+ export class TimelineHighlightRange {
363
+ constructor(color: Color, heightInPx: number, base: number)
364
+ getHeight(): number
365
+ getBase(): number
366
+ getStartTime(): JulianDate
367
+ getStopTime(): JulianDate
368
+ setRange(start: JulianDate, stop: JulianDate): void
369
+ render(renderState: RenderState): string
370
+ }
371
+
372
+ export class TimelineTrack {
373
+ constructor(interval: TimeInterval, pixelHeight: number, color: Color, backgroundColor: Color)
374
+ interval: TimeInterval
375
+ height: number
376
+ color: Color
377
+ backgroundColor: Color
378
+ render(context: CanvasRenderingContext2D, renderState: RenderState)
379
+ }
380
+ }