-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
10881 lines (9420 loc) · 356 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// <reference types="webxr" />
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
declare enum MOUSE {
LEFT = 0,
MIDDLE = 1,
RIGHT = 2,
ROTATE = 0,
DOLLY = 1,
PAN = 2,
}
declare enum TOUCH {
ROTATE = 0,
PAN = 1,
DOLLY_PAN = 2,
DOLLY_ROTATE = 3,
}
// GL STATE CONSTANTS
declare const CullFaceNone: 0;
declare const CullFaceBack: 1;
declare const CullFaceFront: 2;
declare const CullFaceFrontBack: 3;
type CullFace = typeof CullFaceNone | typeof CullFaceBack | typeof CullFaceFront | typeof CullFaceFrontBack;
// Shadowing Type
declare const BasicShadowMap: 0;
declare const PCFShadowMap: 1;
declare const PCFSoftShadowMap: 2;
declare const VSMShadowMap: 3;
type ShadowMapType = typeof BasicShadowMap | typeof PCFShadowMap | typeof PCFSoftShadowMap | typeof VSMShadowMap;
// MATERIAL CONSTANTS
// side
declare const FrontSide: 0;
declare const BackSide: 1;
declare const DoubleSide: 2;
declare const TwoPassDoubleSide: 2;
/**
* Defines which side of faces will be rendered - front, back or both.
* Default is {@link FrontSide}.
*/
type Side = typeof FrontSide | typeof BackSide | typeof DoubleSide | typeof TwoPassDoubleSide;
// blending modes
declare const NoBlending: 0;
declare const NormalBlending: 1;
declare const AdditiveBlending: 2;
declare const SubtractiveBlending: 3;
declare const MultiplyBlending: 4;
declare const CustomBlending: 5;
type Blending =
| typeof NoBlending
| typeof NormalBlending
| typeof AdditiveBlending
| typeof SubtractiveBlending
| typeof MultiplyBlending
| typeof CustomBlending;
// custom blending equations
// (numbers start from 100 not to clash with other
// mappings to OpenGL constants defined in Texture.js)
declare const AddEquation: 100;
declare const SubtractEquation: 101;
declare const ReverseSubtractEquation: 102;
declare const MinEquation: 103;
declare const MaxEquation: 104;
type BlendingEquation =
| typeof AddEquation
| typeof SubtractEquation
| typeof ReverseSubtractEquation
| typeof MinEquation
| typeof MaxEquation;
// custom blending destination factors
declare const ZeroFactor: 200;
declare const OneFactor: 201;
declare const SrcColorFactor: 202;
declare const OneMinusSrcColorFactor: 203;
declare const SrcAlphaFactor: 204;
declare const OneMinusSrcAlphaFactor: 205;
declare const DstAlphaFactor: 206;
declare const OneMinusDstAlphaFactor: 207;
declare const DstColorFactor: 208;
declare const OneMinusDstColorFactor: 209;
type BlendingDstFactor =
| typeof ZeroFactor
| typeof OneFactor
| typeof SrcColorFactor
| typeof OneMinusSrcColorFactor
| typeof SrcAlphaFactor
| typeof OneMinusSrcAlphaFactor
| typeof DstAlphaFactor
| typeof OneMinusDstAlphaFactor
| typeof DstColorFactor
| typeof OneMinusDstColorFactor;
// custom blending src factors
declare const SrcAlphaSaturateFactor: 210;
type BlendingSrcFactor = typeof SrcAlphaSaturateFactor;
// depth modes
declare const NeverDepth: 0;
declare const AlwaysDepth: 1;
declare const LessDepth: 2;
declare const LessEqualDepth: 3;
declare const EqualDepth: 4;
declare const GreaterEqualDepth: 5;
declare const GreaterDepth: 6;
declare const NotEqualDepth: 7;
type DepthModes =
| typeof NeverDepth
| typeof AlwaysDepth
| typeof LessDepth
| typeof LessEqualDepth
| typeof EqualDepth
| typeof GreaterEqualDepth
| typeof GreaterDepth
| typeof NotEqualDepth;
// Tone Mapping modes
declare const NoToneMapping: 0;
declare const LinearToneMapping: 1;
declare const ReinhardToneMapping: 2;
declare const CineonToneMapping: 3;
declare const ACESFilmicToneMapping: 4;
declare const CustomToneMapping: 5;
type ToneMapping =
| typeof NoToneMapping
| typeof LinearToneMapping
| typeof ReinhardToneMapping
| typeof CineonToneMapping
| typeof ACESFilmicToneMapping
| typeof CustomToneMapping;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Mapping modes
/**
* Maps the texture using the mesh's UV coordinates.
* @remarks This is the _default_ value and behaver for Texture Mapping.
*/
declare const UVMapping: 300;
/**
* @remarks This is the _default_ value and behaver for Cube Texture Mapping.
*/
declare const CubeReflectionMapping: 301;
declare const CubeRefractionMapping: 302;
declare const CubeUVReflectionMapping: 306;
declare const EquirectangularReflectionMapping: 303;
declare const EquirectangularRefractionMapping: 304;
/**
* Texture Mapping Modes for non-cube Textures
* @remarks {@link UVMapping} is the _default_ value and behaver for Texture Mapping.
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type Mapping =
| typeof UVMapping
| typeof EquirectangularReflectionMapping
| typeof EquirectangularRefractionMapping;
/**
* Texture Mapping Modes for cube Textures
* @remarks {@link CubeReflectionMapping} is the _default_ value and behaver for Cube Texture Mapping.
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type CubeTextureMapping =
| typeof CubeReflectionMapping
| typeof CubeRefractionMapping
| typeof CubeUVReflectionMapping;
/**
* Texture Mapping Modes for any type of Textures
* @see {@link Mapping} and {@link CubeTextureMapping}
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type AnyMapping = Mapping | CubeTextureMapping;
///////////////////////////////////////////////////////////////////////////////
// Wrapping modes
/** With {@link RepeatWrapping} the texture will simply repeat to infinity. */
declare const RepeatWrapping: 1000;
/**
* With {@link ClampToEdgeWrapping} the last pixel of the texture stretches to the edge of the mesh.
* @remarks This is the _default_ value and behaver for Wrapping Mapping.
*/
declare const ClampToEdgeWrapping: 1001;
/** With {@link MirroredRepeatWrapping} the texture will repeats to infinity, mirroring on each repeat. */
declare const MirroredRepeatWrapping: 1002;
/**
* Texture Wrapping Modes
* @remarks {@link ClampToEdgeWrapping} is the _default_ value and behaver for Wrapping Mapping.
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type Wrapping = typeof RepeatWrapping | typeof ClampToEdgeWrapping | typeof MirroredRepeatWrapping;
///////////////////////////////////////////////////////////////////////////////
// Filters
/** {@link NearestFilter} returns the value of the texture element that is nearest (in Manhattan distance) to the specified texture coordinates. */
declare const NearestFilter: 1003;
/**
* {@link NearestMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured
* and uses the {@link NearestFilter} criterion (the texel nearest to the center of the pixel) to produce a texture value.
*/
declare const NearestMipmapNearestFilter: 1004;
/**
* {@link NearestMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured
* and uses the {@link NearestFilter} criterion (the texel nearest to the center of the pixel) to produce a texture value.
*/
declare const NearestMipMapNearestFilter: 1004;
/**
* {@link NearestMipmapLinearFilter} chooses the two mipmaps that most closely match the size of the pixel being textured
* and uses the {@link NearestFilter} criterion to produce a texture value from each mipmap.
* The final texture value is a weighted average of those two values.
*/
declare const NearestMipmapLinearFilter: 1005;
/**
* {@link NearestMipMapLinearFilter} chooses the two mipmaps that most closely match the size of the pixel being textured
* and uses the {@link NearestFilter} criterion to produce a texture value from each mipmap.
* The final texture value is a weighted average of those two values.
*/
declare const NearestMipMapLinearFilter: 1005;
/**
* {@link LinearFilter} returns the weighted average of the four texture elements that are closest to the specified texture coordinates,
* and can include items wrapped or repeated from other parts of a texture,
* depending on the values of {@link THREE.Texture.wrapS | wrapS} and {@link THREE.Texture.wrapT | wrapT}, and on the exact mapping.
*/
declare const LinearFilter: 1006;
/**
* {@link LinearMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured and
* uses the {@link LinearFilter} criterion (a weighted average of the four texels that are closest to the center of the pixel) to produce a texture value.
*/
declare const LinearMipmapNearestFilter: 1007;
/**
* {@link LinearMipMapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured and
* uses the {@link LinearFilter} criterion (a weighted average of the four texels that are closest to the center of the pixel) to produce a texture value.
*/
declare const LinearMipMapNearestFilter: 1007;
/**
* {@link LinearMipmapLinearFilter} is the default and chooses the two mipmaps that most closely match the size of the pixel being textured and
* uses the {@link LinearFilter} criterion to produce a texture value from each mipmap.
* The final texture value is a weighted average of those two values.
*/
declare const LinearMipmapLinearFilter: 1008;
/**
* {@link LinearMipMapLinearFilter} is the default and chooses the two mipmaps that most closely match the size of the pixel being textured and
* uses the {@link LinearFilter} criterion to produce a texture value from each mipmap.
* The final texture value is a weighted average of those two values.
*/
declare const LinearMipMapLinearFilter: 1008;
/**
* Texture Magnification Filter Modes.
* For use with a texture's {@link THREE.Texture.magFilter | magFilter} property,
* these define the texture magnification function to be used when the pixel being textured maps to an area less than or equal to one texture element (texel).
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
* @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
*/
type MagnificationTextureFilter = typeof NearestFilter | typeof LinearFilter;
/**
* Texture Minification Filter Modes.
* For use with a texture's {@link THREE.Texture.minFilter | minFilter} property,
* these define the texture minifying function that is used whenever the pixel being textured maps to an area greater than one texture element (texel).
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
* @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
*/
type MinificationTextureFilter =
| typeof NearestFilter
| typeof NearestMipmapNearestFilter
| typeof NearestMipMapNearestFilter
| typeof NearestMipmapLinearFilter
| typeof NearestMipMapLinearFilter
| typeof LinearFilter
| typeof LinearMipmapNearestFilter
| typeof LinearMipMapNearestFilter
| typeof LinearMipmapLinearFilter
| typeof LinearMipMapLinearFilter;
///////////////////////////////////////////////////////////////////////////////
// Data types
declare const UnsignedByteType: 1009;
declare const ByteType: 1010;
declare const ShortType: 1011;
declare const UnsignedShortType: 1012;
declare const IntType: 1013;
declare const UnsignedIntType: 1014;
declare const FloatType: 1015;
declare const HalfFloatType: 1016;
declare const UnsignedShort4444Type: 1017;
declare const UnsignedShort5551Type: 1018;
declare const UnsignedInt248Type: 1020;
type AttributeGPUType = typeof FloatType | typeof IntType;
/**
* Texture Types.
* @remarks Must correspond to the correct {@link PixelFormat | format}.
* @see {@link THREE.Texture.type}
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type TextureDataType =
| typeof UnsignedByteType
| typeof ByteType
| typeof ShortType
| typeof UnsignedShortType
| typeof IntType
| typeof UnsignedIntType
| typeof FloatType
| typeof HalfFloatType
| typeof UnsignedShort4444Type
| typeof UnsignedShort5551Type
| typeof UnsignedInt248Type;
///////////////////////////////////////////////////////////////////////////////
// Pixel formats
/** {@link AlphaFormat} discards the red, green and blue components and reads just the alpha component. */
declare const AlphaFormat: 1021;
/** {@link RGBAFormat} discards the green and blue components and reads just the red component. (Can only be used with a WebGL 2 rendering context). */
declare const RGBAFormat: 1023;
/**
* {@link LuminanceFormat} reads each element as a single luminance component.
* This is then converted to a floating point, clamped to the range `[0,1]`, and then assembled into an RGBA element by
* placing the luminance value in the red, green and blue channels, and attaching `1.0` to the alpha channel.
*/
declare const LuminanceFormat: 1024;
/**
* {@link LuminanceAlphaFormat} reads each element as a luminance/alpha double.
* The same process occurs as for the {@link LuminanceFormat}, except that the alpha channel may have values other than `1.0`.
*/
declare const LuminanceAlphaFormat: 1025;
/**
* {@link DepthFormat} reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`.
* @remarks This is the default for {@link THREE.DepthTexture}.
*/
declare const DepthFormat: 1026;
/**
* {@link DepthStencilFormat} reads each element is a pair of depth and stencil values.
* The depth component of the pair is interpreted as in {@link DepthFormat}.
* The stencil component is interpreted based on the depth + stencil internal format.
*/
declare const DepthStencilFormat: 1027;
/**
* {@link RedFormat} discards the green and blue components and reads just the red component.
* @remarks Can only be used with a WebGL 2 rendering context.
*/
declare const RedFormat: 1028;
/**
* {@link RedIntegerFormat} discards the green and blue components and reads just the red component.
* The texels are read as integers instead of floating point.
* @remarks Can only be used with a WebGL 2 rendering context.
*/
declare const RedIntegerFormat: 1029;
/**
* {@link RGFormat} discards the alpha, and blue components and reads the red, and green components.
* @remarks Can only be used with a WebGL 2 rendering context.
*/
declare const RGFormat: 1030;
/**
* {@link RGIntegerFormat} discards the alpha, and blue components and reads the red, and green components.
* The texels are read as integers instead of floating point.
* @remarks Can only be used with a WebGL 2 rendering context.
*/
declare const RGIntegerFormat: 1031;
/**
* {@link RGBAIntegerFormat} reads the red, green, blue and alpha component
* @remarks This is the default for {@link THREE.Texture}.
*/
declare const RGBAIntegerFormat: 1033;
declare const _SRGBAFormat: 1035; // fallback for WebGL 1
/**
* Texture Pixel Formats Modes. Compatible only with {@link WebGLRenderingContext | WebGL 1 Rendering Context}.
* @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
* @see {@link WebGLRenderingContext.texImage2D} for details.
* @see {@link WebGL2PixelFormat} and {@link PixelFormat}
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type WebGL1PixelFormat =
| typeof AlphaFormat
| typeof LuminanceFormat
| typeof LuminanceAlphaFormat
| typeof DepthFormat
| typeof DepthStencilFormat
| typeof RedFormat
| typeof RedIntegerFormat
| typeof RGFormat
| typeof _SRGBAFormat;
/**
* Texture Pixel Formats Modes. Compatible only with {@link WebGL2RenderingContext | WebGL 2 Rendering Context}.
* @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
* @see {@link WebGLRenderingContext.texImage2D} for details.
* @see {@link WebGL2PixelFormat} and {@link PixelFormat}
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type WebGL2PixelFormat =
| typeof AlphaFormat
| typeof RGBAFormat
| typeof LuminanceFormat
| typeof LuminanceAlphaFormat
| typeof DepthFormat
| typeof DepthStencilFormat
| typeof RedFormat
| typeof RedIntegerFormat
| typeof RGFormat
| typeof RGIntegerFormat
| typeof RGBAIntegerFormat
| typeof _SRGBAFormat;
/**
* All Texture Pixel Formats Modes.
* @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
* @see {@link WebGLRenderingContext.texImage2D} for details.
* @see {@link WebGL1PixelFormat} and {@link WebGL2PixelFormat}
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type PixelFormat = WebGL1PixelFormat | WebGL2PixelFormat;
/**
* All Texture Pixel Formats Modes for {@link THREE.DeepTexture}.
* @see {@link WebGLRenderingContext.texImage2D} for details.
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type DeepTexturePixelFormat = typeof DepthFormat | typeof DepthStencilFormat;
///////////////////////////////////////////////////////////////////////////////
// Compressed texture formats
// DDS / ST3C Compressed texture formats
/**
* A DXT1-compressed image in an RGB image format.
* @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
*/
declare const RGB_S3TC_DXT1_Format: 33776;
/**
* A DXT1-compressed image in an RGB image format with a simple on/off alpha value.
* @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
*/
declare const RGBA_S3TC_DXT1_Format: 33777;
/**
* A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.
* @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
*/
declare const RGBA_S3TC_DXT3_Format: 33778;
/**
* A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.
* @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
*/
declare const RGBA_S3TC_DXT5_Format: 33779;
// PVRTC compressed './texture formats
/**
* RGB compression in 4-bit mode. One block for each 4×4 pixels.
* @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
*/
declare const RGB_PVRTC_4BPPV1_Format: 35840;
/**
* RGB compression in 2-bit mode. One block for each 8×4 pixels.
* @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
*/
declare const RGB_PVRTC_2BPPV1_Format: 35841;
/**
* RGBA compression in 4-bit mode. One block for each 4×4 pixels.
* @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
*/
declare const RGBA_PVRTC_4BPPV1_Format: 35842;
/**
* RGBA compression in 2-bit mode. One block for each 8×4 pixels.
* @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
*/
declare const RGBA_PVRTC_2BPPV1_Format: 35843;
// ETC compressed texture formats
/**
* @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
*/
declare const RGB_ETC1_Format: 36196;
/**
* @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
*/
declare const RGB_ETC2_Format: 37492;
/**
* @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
*/
declare const RGBA_ETC2_EAC_Format: 37496;
// ASTC compressed texture formats
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_4x4_Format: 37808;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_5x4_Format: 37809;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_5x5_Format: 37810;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_6x5_Format: 37811;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_6x6_Format: 37812;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_8x5_Format: 37813;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_8x6_Format: 37814;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_8x8_Format: 37815;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_10x5_Format: 37816;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_10x6_Format: 37817;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_10x8_Format: 37818;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_10x10_Format: 37819;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_12x10_Format: 37820;
/**
* @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
*/
declare const RGBA_ASTC_12x12_Format: 37821;
// BPTC compressed texture formats
/**
* @remarks Require support for the _EXT_texture_compression_bptc_ WebGL extension.
*/
declare const RGBA_BPTC_Format: 36492;
declare const RGB_BPTC_SIGNED_Format = 36494;
declare const RGB_BPTC_UNSIGNED_Format = 36495;
// RGTC compressed texture formats
declare const RED_RGTC1_Format: 36283;
declare const SIGNED_RED_RGTC1_Format: 36284;
declare const RED_GREEN_RGTC2_Format: 36285;
declare const SIGNED_RED_GREEN_RGTC2_Format: 36286;
/**
* For use with a {@link THREE.CompressedTexture}'s {@link THREE.CompressedTexture.format | .format} property.
* @remarks Compressed Require support for correct WebGL extension.
*/
type CompressedPixelFormat =
| typeof RGB_S3TC_DXT1_Format
| typeof RGBA_S3TC_DXT1_Format
| typeof RGBA_S3TC_DXT3_Format
| typeof RGBA_S3TC_DXT5_Format
| typeof RGB_PVRTC_4BPPV1_Format
| typeof RGB_PVRTC_2BPPV1_Format
| typeof RGBA_PVRTC_4BPPV1_Format
| typeof RGBA_PVRTC_2BPPV1_Format
| typeof RGB_ETC1_Format
| typeof RGB_ETC2_Format
| typeof RGBA_ETC2_EAC_Format
| typeof RGBA_ASTC_4x4_Format
| typeof RGBA_ASTC_5x4_Format
| typeof RGBA_ASTC_5x5_Format
| typeof RGBA_ASTC_6x5_Format
| typeof RGBA_ASTC_6x6_Format
| typeof RGBA_ASTC_8x5_Format
| typeof RGBA_ASTC_8x6_Format
| typeof RGBA_ASTC_8x8_Format
| typeof RGBA_ASTC_10x5_Format
| typeof RGBA_ASTC_10x6_Format
| typeof RGBA_ASTC_10x8_Format
| typeof RGBA_ASTC_10x10_Format
| typeof RGBA_ASTC_12x10_Format
| typeof RGBA_ASTC_12x12_Format
| typeof RGBA_BPTC_Format
| typeof RGB_BPTC_SIGNED_Format
| typeof RGB_BPTC_UNSIGNED_Format
| typeof RED_RGTC1_Format
| typeof SIGNED_RED_RGTC1_Format
| typeof RED_GREEN_RGTC2_Format
| typeof SIGNED_RED_GREEN_RGTC2_Format;
///////////////////////////////////////////////////////////////////////////////
/**
* All Possible Texture Pixel Formats Modes. For any Type or SubType of Textures.
* @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
* @see {@link WebGLRenderingContext.texImage2D} for details.
* @see {@link PixelFormat} and {@link DeepTexturePixelFormat} and {@link CompressedPixelFormat}
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
*/
type AnyPixelFormat = PixelFormat | DeepTexturePixelFormat | CompressedPixelFormat;
// Interpolation
declare const InterpolateDiscrete: 2300;
declare const InterpolateLinear: 2301;
declare const InterpolateSmooth: 2302;
type InterpolationModes = typeof InterpolateDiscrete | typeof InterpolateLinear | typeof InterpolateSmooth;
// Animation blending modes
declare const NormalAnimationBlendMode: 2500;
declare const AdditiveAnimationBlendMode: 2501;
type AnimationBlendMode = typeof NormalAnimationBlendMode | typeof AdditiveAnimationBlendMode;
///////////////////////////////////////////////////////////////////////////////
// Texture Encodings
/** @deprecated Use {@link LinearSRGBColorSpace} or {@link NoColorSpace} in three.js r152+. */
declare const LinearEncoding: 3000;
/** @deprecated Use {@link SRGBColorSpace} in three.js r152+. */
declare const sRGBEncoding: 3001;
/**
* Texture Encodings.
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
* @deprecated Use {@link ColorSpace} in three.js r152+.
*/
type TextureEncoding = typeof LinearEncoding | typeof sRGBEncoding;
///////////////////////////////////////////////////////////////////////////////
// Normal Map types
declare const TangentSpaceNormalMap: 0;
declare const ObjectSpaceNormalMap: 1;
type NormalMapTypes = typeof TangentSpaceNormalMap | typeof ObjectSpaceNormalMap;
declare const NoColorSpace: '';
declare const SRGBColorSpace: 'srgb';
declare const LinearSRGBColorSpace: 'srgb-linear';
declare const DisplayP3ColorSpace: 'display-p3';
declare const LinearDisplayP3ColorSpace = 'display-p3-linear';
type ColorSpace =
| typeof NoColorSpace
| typeof SRGBColorSpace
| typeof LinearSRGBColorSpace
| typeof DisplayP3ColorSpace
| typeof LinearDisplayP3ColorSpace;
// Stencil Op types
declare const ZeroStencilOp: 0;
declare const KeepStencilOp: 7680;
declare const ReplaceStencilOp: 7681;
declare const IncrementStencilOp: 7682;
declare const DecrementStencilOp: 7283;
declare const IncrementWrapStencilOp: 34055;
declare const DecrementWrapStencilOp: 34056;
declare const InvertStencilOp: 5386;
type StencilOp =
| typeof ZeroStencilOp
| typeof KeepStencilOp
| typeof ReplaceStencilOp
| typeof IncrementStencilOp
| typeof DecrementStencilOp
| typeof IncrementWrapStencilOp
| typeof DecrementWrapStencilOp
| typeof InvertStencilOp;
// Stencil Func types
declare const NeverStencilFunc: 512;
declare const LessStencilFunc: 513;
declare const EqualStencilFunc: 514;
declare const LessEqualStencilFunc: 515;
declare const GreaterStencilFunc: 516;
declare const NotEqualStencilFunc: 517;
declare const GreaterEqualStencilFunc: 518;
declare const AlwaysStencilFunc: 519;
type StencilFunc =
| typeof NeverStencilFunc
| typeof LessStencilFunc
| typeof EqualStencilFunc
| typeof LessEqualStencilFunc
| typeof GreaterStencilFunc
| typeof NotEqualStencilFunc
| typeof GreaterEqualStencilFunc
| typeof AlwaysStencilFunc;
declare const NeverCompare: 512;
declare const LessCompare: 513;
declare const EqualCompare: 514;
declare const LessEqualCompare: 515;
declare const GreaterCompare: 516;
declare const NotEqualCompare: 517;
declare const GreaterEqualCompare: 518;
declare const AlwaysCompare: 519;
type TextureComparisonFunction =
| typeof NeverCompare
| typeof LessCompare
| typeof EqualCompare
| typeof LessEqualCompare
| typeof GreaterCompare
| typeof NotEqualCompare
| typeof GreaterEqualCompare
| typeof AlwaysCompare;
// usage types
declare const StaticDrawUsage: 35044;
declare const DynamicDrawUsage: 35048;
declare const StreamDrawUsage: 35040;
declare const StaticReadUsage: 35045;
declare const DynamicReadUsage: 35049;
declare const StreamReadUsage: 35041;
declare const StaticCopyUsage: 35046;
declare const DynamicCopyUsage: 35050;
declare const StreamCopyUsage: 35042;
type Usage =
| typeof StaticDrawUsage
| typeof DynamicDrawUsage
| typeof StreamDrawUsage
| typeof StaticReadUsage
| typeof DynamicReadUsage
| typeof StreamReadUsage
| typeof StaticCopyUsage
| typeof DynamicCopyUsage
| typeof StreamCopyUsage;
declare const WebGLCoordinateSystem: 2000;
declare const WebGPUCoordinateSystem: 2001;
type CoordinateSystem = typeof WebGLCoordinateSystem | typeof WebGPUCoordinateSystem;
///////////////////////////////////////////////////////////////////////////////
// Texture - Internal Pixel Formats
/**
* For use with a texture's {@link THREE.Texture.internalFormat} property, these define how elements of a {@link THREE.Texture}, or texels, are stored on the GPU.
* - `R8` stores the red component on 8 bits.
* - `R8_SNORM` stores the red component on 8 bits. The component is stored as normalized.
* - `R8I` stores the red component on 8 bits. The component is stored as an integer.
* - `R8UI` stores the red component on 8 bits. The component is stored as an unsigned integer.
* - `R16I` stores the red component on 16 bits. The component is stored as an integer.
* - `R16UI` stores the red component on 16 bits. The component is stored as an unsigned integer.
* - `R16F` stores the red component on 16 bits. The component is stored as floating point.
* - `R32I` stores the red component on 32 bits. The component is stored as an integer.
* - `R32UI` stores the red component on 32 bits. The component is stored as an unsigned integer.
* - `R32F` stores the red component on 32 bits. The component is stored as floating point.
* - `RG8` stores the red and green components on 8 bits each.
* - `RG8_SNORM` stores the red and green components on 8 bits each. Every component is stored as normalized.
* - `RG8I` stores the red and green components on 8 bits each. Every component is stored as an integer.
* - `RG8UI` stores the red and green components on 8 bits each. Every component is stored as an unsigned integer.
* - `RG16I` stores the red and green components on 16 bits each. Every component is stored as an integer.
* - `RG16UI` stores the red and green components on 16 bits each. Every component is stored as an unsigned integer.
* - `RG16F` stores the red and green components on 16 bits each. Every component is stored as floating point.
* - `RG32I` stores the red and green components on 32 bits each. Every component is stored as an integer.
* - `RG32UI` stores the red and green components on 32 bits. Every component is stored as an unsigned integer.
* - `RG32F` stores the red and green components on 32 bits. Every component is stored as floating point.
* - `RGB8` stores the red, green, and blue components on 8 bits each. RGB8_SNORM` stores the red, green, and blue components on 8 bits each. Every component is stored as normalized.
* - `RGB8I` stores the red, green, and blue components on 8 bits each. Every component is stored as an integer.
* - `RGB8UI` stores the red, green, and blue components on 8 bits each. Every component is stored as an unsigned integer.
* - `RGB16I` stores the red, green, and blue components on 16 bits each. Every component is stored as an integer.
* - `RGB16UI` stores the red, green, and blue components on 16 bits each. Every component is stored as an unsigned integer.
* - `RGB16F` stores the red, green, and blue components on 16 bits each. Every component is stored as floating point
* - `RGB32I` stores the red, green, and blue components on 32 bits each. Every component is stored as an integer.
* - `RGB32UI` stores the red, green, and blue components on 32 bits each. Every component is stored as an unsigned integer.
* - `RGB32F` stores the red, green, and blue components on 32 bits each. Every component is stored as floating point
* - `R11F_G11F_B10F` stores the red, green, and blue components respectively on 11 bits, 11 bits, and 10bits. Every component is stored as floating point.
* - `RGB565` stores the red, green, and blue components respectively on 5 bits, 6 bits, and 5 bits.
* - `RGB9_E5` stores the red, green, and blue components on 9 bits each.
* - `RGBA8` stores the red, green, blue, and alpha components on 8 bits each.
* - `RGBA8_SNORM` stores the red, green, blue, and alpha components on 8 bits. Every component is stored as normalized.
* - `RGBA8I` stores the red, green, blue, and alpha components on 8 bits each. Every component is stored as an integer.
* - `RGBA8UI` stores the red, green, blue, and alpha components on 8 bits. Every component is stored as an unsigned integer.
* - `RGBA16I` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as an integer.
* - `RGBA16UI` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as an unsigned integer.
* - `RGBA16F` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as floating point.
* - `RGBA32I` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as an integer.
* - `RGBA32UI` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as an unsigned integer.
* - `RGBA32F` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as floating point.
* - `RGB5_A1` stores the red, green, blue, and alpha components respectively on 5 bits, 5 bits, 5 bits, and 1 bit.
* - `RGB10_A2` stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits.
* - `RGB10_A2UI` stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits. Every component is stored as an unsigned integer.
* - `SRGB8` stores the red, green, and blue components on 8 bits each.
* - `SRGB8_ALPHA8` stores the red, green, blue, and alpha components on 8 bits each.
* - `DEPTH_COMPONENT16` stores the depth component on 16bits.
* - `DEPTH_COMPONENT24` stores the depth component on 24bits.
* - `DEPTH_COMPONENT32F` stores the depth component on 32bits. The component is stored as floating point.
* - `DEPTH24_STENCIL8` stores the depth, and stencil components respectively on 24 bits and 8 bits. The stencil component is stored as an unsigned integer.
* - `DEPTH32F_STENCIL8` stores the depth, and stencil components respectively on 32 bits and 8 bits. The depth component is stored as floating point, and the stencil component as an unsigned integer.
* @remark Note that the texture must have the correct {@link THREE.Texture.type} set, as well as the correct {@link THREE.Texture.format}.
* @see {@link WebGLRenderingContext.texImage2D} and {@link WebGLRenderingContext.texImage3D} for more details regarding the possible combination
* of {@link THREE.Texture.format}, {@link THREE.Texture.internalFormat}, and {@link THREE.Texture.type}.
* @see {@link https://registry.khronos.org/webgl/specs/latest/2.0/ | WebGL2 Specification} and
* {@link https://registry.khronos.org/OpenGL/specs/es/3.0/es_spec_3.0.pdf | OpenGL ES 3.0 Specification} For more in-depth information regarding internal formats.
*/
type PixelFormatGPU =
| 'ALPHA'
| 'RGB'
| 'RGBA'
| 'LUMINANCE'
| 'LUMINANCE_ALPHA'
| 'RED_INTEGER'
| 'R8'
| 'R8_SNORM'
| 'R8I'
| 'R8UI'
| 'R16I'
| 'R16UI'
| 'R16F'
| 'R32I'
| 'R32UI'
| 'R32F'
| 'RG8'
| 'RG8_SNORM'
| 'RG8I'
| 'RG8UI'
| 'RG16I'
| 'RG16UI'
| 'RG16F'
| 'RG32I'
| 'RG32UI'
| 'RG32F'
| 'RGB565'
| 'RGB8'
| 'RGB8_SNORM'
| 'RGB8I'
| 'RGB8UI'
| 'RGB16I'
| 'RGB16UI'
| 'RGB16F'
| 'RGB32I'
| 'RGB32UI'
| 'RGB32F'
| 'RGB9_E5'
| 'SRGB8'
| 'R11F_G11F_B10F'
| 'RGBA4'
| 'RGBA8'
| 'RGBA8_SNORM'
| 'RGBA8I'
| 'RGBA8UI'
| 'RGBA16I'
| 'RGBA16UI'
| 'RGBA16F'
| 'RGBA32I'
| 'RGBA32UI'
| 'RGBA32F'
| 'RGB5_A1'
| 'RGB10_A2'
| 'RGB10_A2UI'
| 'SRGB8_ALPHA8'
| 'SRGB8'
| 'DEPTH_COMPONENT16'
| 'DEPTH_COMPONENT24'
| 'DEPTH_COMPONENT32F'
| 'DEPTH24_STENCIL8'
| 'DEPTH32F_STENCIL8';
declare abstract class Interpolant {
constructor(parameterPositions: any, sampleValues: any, sampleSize: number, resultBuffer?: any);
parameterPositions: any;
sampleValues: any;
valueSize: number;
resultBuffer: any;
evaluate(time: number): any;
}
declare class DiscreteInterpolant extends Interpolant {
constructor(parameterPositions: any, samplesValues: any, sampleSize: number, resultBuffer?: any);
interpolate_(i1: number, t0: number, t: number, t1: number): any;
}
declare class LinearInterpolant extends Interpolant {
constructor(parameterPositions: any, samplesValues: any, sampleSize: number, resultBuffer?: any);
interpolate_(i1: number, t0: number, t: number, t1: number): any;
}
declare class CubicInterpolant extends Interpolant {
constructor(parameterPositions: any, samplesValues: any, sampleSize: number, resultBuffer?: any);
interpolate_(i1: number, t0: number, t: number, t1: number): any;
}
declare class KeyframeTrack {
/**
* @param name
* @param times
* @param values
* @param [interpolation=THREE.InterpolateLinear]
*/
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>, interpolation?: InterpolationModes);
name: string;
times: Float32Array;
values: Float32Array;
ValueTypeName: string;
TimeBufferType: Float32Array;
ValueBufferType: Float32Array;
/**
* @default THREE.InterpolateLinear
*/
DefaultInterpolation: InterpolationModes;
InterpolantFactoryMethodDiscrete(result: any): DiscreteInterpolant;
InterpolantFactoryMethodLinear(result: any): LinearInterpolant;
InterpolantFactoryMethodSmooth(result: any): CubicInterpolant;
setInterpolation(interpolation: InterpolationModes): KeyframeTrack;
getInterpolation(): InterpolationModes;
createInterpolant(): Interpolant;
getValueSize(): number;
shift(timeOffset: number): KeyframeTrack;
scale(timeScale: number): KeyframeTrack;
trim(startTime: number, endTime: number): KeyframeTrack;
validate(): boolean;
optimize(): KeyframeTrack;
clone(): this;
static toJSON(track: KeyframeTrack): any;
}
type Vector2Tuple = [number, number];
/**
* ( interface Vector<T> )
*
* Abstract interface of {@link https://github.com/mrdoob/three.js/blob/master/src/math/Vector2.js|Vector2},
* {@link https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js|Vector3}
* and {@link https://github.com/mrdoob/three.js/blob/master/src/math/Vector4.js|Vector4}.
*
* Currently the members of Vector is NOT type safe because it accepts different typed vectors.
*
* Those definitions will be changed when TypeScript innovates Generics to be type safe.
*
* @example
* const v:THREE.Vector = new THREE.Vector3();
* v.addVectors(new THREE.Vector2(0, 1), new THREE.Vector2(2, 3)); // invalid but compiled successfully
*/
interface Vector {
setComponent(index: number, value: number): this;
getComponent(index: number): number;
set(...args: number[]): this;
setScalar(scalar: number): this;
/**
* copy(v:T):T;
*/
copy(v: Vector): this;
/**
* NOTE: The second argument is deprecated.
*
* add(v:T):T;
*/
add(v: Vector): this;