Repository navigation
Expand file tree
/
Copy pathMetalKit.d.ts
More file actions
360 lines (190 loc) · 12.8 KB
/
Copy pathMetalKit.d.ts
File metadata and controls
360 lines (190 loc) · 12.8 KB
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
/// <reference types="@nativescript/objc-node-api" />
/// <reference path="./Runtime.d.ts" />
/// <reference path="./AppKit.d.ts" />
declare const MTKModelErrorKey: string;
declare const MTKModelErrorDomain: string;
declare const MTKTextureLoaderOriginFlippedVertically: string;
declare const MTKTextureLoaderOptionOrigin: string;
declare const MTKTextureLoaderCubeLayoutVertical: string;
declare const MTKTextureLoaderOptionCubeLayout: string;
declare const MTKTextureLoaderOptionTextureStorageMode: string;
declare const MTKTextureLoaderOptionTextureCPUCacheMode: string;
declare const MTKTextureLoaderOptionSRGB: string;
declare const MTKTextureLoaderOptionAllocateMipmaps: string;
declare const MTKTextureLoaderOriginBottomLeft: string;
declare const MTKTextureLoaderOptionLoadAsArray: string;
declare const MTKTextureLoaderOptionTextureUsage: string;
declare const MTKTextureLoaderErrorDomain: string;
declare const MTKTextureLoaderOptionGenerateMipmaps: string;
declare const MTKTextureLoaderErrorKey: string;
declare const MTKTextureLoaderOriginTopLeft: string;
declare function MTKModelIOVertexDescriptorFromMetal(metalDescriptor: MTLVertexDescriptor): MDLVertexDescriptor;
declare function MTKModelIOVertexDescriptorFromMetalWithError(metalDescriptor: MTLVertexDescriptor, error: interop.PointerConvertible): MDLVertexDescriptor;
declare function MTKMetalVertexDescriptorFromModelIO(modelIODescriptor: MDLVertexDescriptor): MTLVertexDescriptor;
declare function MTKMetalVertexDescriptorFromModelIOWithError(modelIODescriptor: MDLVertexDescriptor, error: interop.PointerConvertible): MTLVertexDescriptor;
declare function MTKModelIOVertexFormatFromMetal(vertexFormat: interop.Enum<typeof MTLVertexFormat>): interop.Enum<typeof MDLVertexFormat>;
declare function MTKMetalVertexFormatFromModelIO(vertexFormat: interop.Enum<typeof MDLVertexFormat>): interop.Enum<typeof MTLVertexFormat>;
declare interface MTKViewDelegate extends NSObjectProtocol {
mtkViewDrawableSizeWillChange(view: MTKView, size: CGSize): void;
drawInMTKView(view: MTKView): void;
}
declare class MTKViewDelegate extends NativeObject implements MTKViewDelegate {
}
declare class MTKMesh extends NSObject {
initWithMeshDeviceError(mesh: MDLMesh, device: MTLDevice, error: interop.PointerConvertible): this;
static newMeshesFromAssetDeviceSourceMeshesError(asset: MDLAsset, device: MTLDevice, sourceMeshes: interop.PointerConvertible, error: interop.PointerConvertible): NSArray;
readonly vertexBuffers: NSArray;
readonly vertexDescriptor: MDLVertexDescriptor;
readonly submeshes: NSArray;
readonly vertexCount: number;
name: string;
}
declare class MTKSubmesh extends NSObject {
readonly primitiveType: interop.Enum<typeof MTLPrimitiveType>;
readonly indexType: interop.Enum<typeof MTLIndexType>;
readonly indexBuffer: MTKMeshBuffer;
readonly indexCount: number;
readonly mesh: MTKMesh;
name: string;
}
declare class MTKMeshBufferAllocator extends NSObject implements MDLMeshBufferAllocator {
initWithDevice(device: MTLDevice): this;
readonly device: MTLDevice;
newZone(capacity: number): MDLMeshBufferZone;
newZoneForBuffersWithSizeAndType(sizes: NSArray<interop.Object> | Array<interop.Object>, types: NSArray<interop.Object> | Array<interop.Object>): MDLMeshBufferZone;
newBufferType(length: number, type: interop.Enum<typeof MDLMeshBufferType>): MDLMeshBuffer;
newBufferWithDataType(data: NSData, type: interop.Enum<typeof MDLMeshBufferType>): MDLMeshBuffer;
newBufferFromZoneLengthType(zone: MDLMeshBufferZone | null, length: number, type: interop.Enum<typeof MDLMeshBufferType>): MDLMeshBuffer;
newBufferFromZoneDataType(zone: MDLMeshBufferZone | null, data: NSData, type: interop.Enum<typeof MDLMeshBufferType>): MDLMeshBuffer;
isEqual(object: interop.Object): boolean;
readonly hash: number;
readonly superclass: interop.Object;
class(): interop.Object;
self(): this;
performSelector(aSelector: string): interop.Object;
performSelectorWithObject(aSelector: string, object: interop.Object): interop.Object;
performSelectorWithObjectWithObject(aSelector: string, object1: interop.Object, object2: interop.Object): interop.Object;
readonly isProxy: boolean;
isKindOfClass(aClass: interop.Object): boolean;
isMemberOfClass(aClass: interop.Object): boolean;
conformsToProtocol(aProtocol: interop.PointerConvertible): boolean;
respondsToSelector(aSelector: string): boolean;
retain(): this;
release(): void;
autorelease(): this;
retainCount(): number;
readonly zone: interop.Pointer;
readonly description: string;
readonly debugDescription: string;
}
declare class MTKView extends NSView implements NSCoding, CALayerDelegate {
initWithFrameDevice(frameRect: CGRect, device: MTLDevice | null): this;
initWithCoder(coder: NSCoder): this;
delegate: MTKViewDelegate;
device: MTLDevice;
readonly currentDrawable: CAMetalDrawable;
framebufferOnly: boolean;
depthStencilAttachmentTextureUsage: interop.Enum<typeof MTLTextureUsage>;
multisampleColorAttachmentTextureUsage: interop.Enum<typeof MTLTextureUsage>;
presentsWithTransaction: boolean;
colorPixelFormat: interop.Enum<typeof MTLPixelFormat>;
depthStencilPixelFormat: interop.Enum<typeof MTLPixelFormat>;
depthStencilStorageMode: interop.Enum<typeof MTLStorageMode>;
sampleCount: number;
clearColor: MTLClearColor;
clearDepth: number;
clearStencil: number;
readonly depthStencilTexture: MTLTexture;
readonly multisampleColorTexture: MTLTexture;
releaseDrawables(): void;
readonly currentRenderPassDescriptor: MTLRenderPassDescriptor;
preferredFramesPerSecond: number;
enableSetNeedsDisplay: boolean;
autoResizeDrawable: boolean;
drawableSize: CGSize;
readonly preferredDrawableSize: CGSize;
readonly preferredDevice: MTLDevice;
isPaused: boolean;
get colorspace(): interop.Pointer;
set colorspace(value: interop.PointerConvertible);
draw(): void;
encodeWithCoder(coder: NSCoder): void;
displayLayer(layer: CALayer): void;
drawLayerInContext(layer: CALayer, ctx: interop.PointerConvertible): void;
layerWillDraw(layer: CALayer): void;
layoutSublayersOfLayer(layer: CALayer): void;
actionForLayerForKey(layer: CALayer, event: string): CAAction;
isEqual(object: interop.Object): boolean;
readonly hash: number;
readonly superclass: interop.Object;
class(): interop.Object;
self(): this;
performSelector(aSelector: string): interop.Object;
performSelectorWithObject(aSelector: string, object: interop.Object): interop.Object;
performSelectorWithObjectWithObject(aSelector: string, object1: interop.Object, object2: interop.Object): interop.Object;
readonly isProxy: boolean;
isKindOfClass(aClass: interop.Object): boolean;
isMemberOfClass(aClass: interop.Object): boolean;
conformsToProtocol(aProtocol: interop.PointerConvertible): boolean;
respondsToSelector(aSelector: string): boolean;
retain(): this;
release(): void;
autorelease(): this;
retainCount(): number;
readonly zone: interop.Pointer;
readonly description: string;
readonly debugDescription: string;
}
declare class MTKTextureLoader extends NSObject {
readonly device: MTLDevice;
initWithDevice(device: MTLDevice): this;
newTextureWithContentsOfURLOptionsCompletionHandler(URL: NSURL, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: MTLTexture, p2: NSError) => void): void;
newTextureWithNameScaleFactorBundleOptionsCompletionHandler(name: string, scaleFactor: number, bundle: NSBundle | null, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: MTLTexture, p2: NSError) => void): void;
newTextureWithNameScaleFactorDisplayGamutBundleOptionsCompletionHandler(name: string, scaleFactor: number, displayGamut: interop.Enum<typeof NSDisplayGamut>, bundle: NSBundle | null, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: MTLTexture, p2: NSError) => void): void;
newTexturesWithContentsOfURLsOptionsCompletionHandler(URLs: NSArray<interop.Object> | Array<interop.Object>, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: NSArray<interop.Object> | Array<interop.Object>, p2: NSError) => void): void;
newTexturesWithNamesScaleFactorBundleOptionsCompletionHandler(names: NSArray<interop.Object> | Array<interop.Object>, scaleFactor: number, bundle: NSBundle | null, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: NSArray<interop.Object> | Array<interop.Object>, p2: NSError) => void): void;
newTexturesWithNamesScaleFactorDisplayGamutBundleOptionsCompletionHandler(names: NSArray<interop.Object> | Array<interop.Object>, scaleFactor: number, displayGamut: interop.Enum<typeof NSDisplayGamut>, bundle: NSBundle | null, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: NSArray<interop.Object> | Array<interop.Object>, p2: NSError) => void): void;
newTextureWithDataOptionsCompletionHandler(data: NSData, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: MTLTexture, p2: NSError) => void): void;
newTextureWithCGImageOptionsCompletionHandler(cgImage: interop.PointerConvertible, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: MTLTexture, p2: NSError) => void): void;
newTextureWithMDLTextureOptionsCompletionHandler(texture: MDLTexture, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, completionHandler: (p1: MTLTexture, p2: NSError) => void): void;
newTextureWithContentsOfURLOptionsError(URL: NSURL, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, error: interop.PointerConvertible): MTLTexture;
newTexturesWithContentsOfURLsOptionsError(URLs: NSArray<interop.Object> | Array<interop.Object>, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, error: interop.PointerConvertible): NSArray;
newTextureWithDataOptionsError(data: NSData, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, error: interop.PointerConvertible): MTLTexture;
newTextureWithCGImageOptionsError(cgImage: interop.PointerConvertible, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, error: interop.PointerConvertible): MTLTexture;
newTextureWithMDLTextureOptionsError(texture: MDLTexture, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, error: interop.PointerConvertible): MTLTexture;
newTextureWithNameScaleFactorBundleOptionsError(name: string, scaleFactor: number, bundle: NSBundle | null, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, error: interop.PointerConvertible): MTLTexture;
newTextureWithNameScaleFactorDisplayGamutBundleOptionsError(name: string, scaleFactor: number, displayGamut: interop.Enum<typeof NSDisplayGamut>, bundle: NSBundle | null, options: NSDictionary<interop.Object, interop.Object> | Record<interop.Object, interop.Object> | null, error: interop.PointerConvertible): MTLTexture;
}
// @ts-ignore ClassDecl.tsIgnore
declare class MTKMeshBuffer extends NSObject implements MDLMeshBuffer, MDLNamed {
readonly length: number;
readonly allocator: MTKMeshBufferAllocator;
// @ts-ignore MemberDecl.tsIgnore
readonly zone: MDLMeshBufferZone;
readonly buffer: MTLBuffer;
readonly offset: number;
readonly type: interop.Enum<typeof MDLMeshBufferType>;
fillDataOffset(data: NSData, offset: number): void;
map(): MDLMeshBufferMap;
isEqual(object: interop.Object): boolean;
readonly hash: number;
readonly superclass: interop.Object;
class(): interop.Object;
self(): this;
performSelector(aSelector: string): interop.Object;
performSelectorWithObject(aSelector: string, object: interop.Object): interop.Object;
performSelectorWithObjectWithObject(aSelector: string, object1: interop.Object, object2: interop.Object): interop.Object;
readonly isProxy: boolean;
isKindOfClass(aClass: interop.Object): boolean;
isMemberOfClass(aClass: interop.Object): boolean;
conformsToProtocol(aProtocol: interop.PointerConvertible): boolean;
respondsToSelector(aSelector: string): boolean;
retain(): this;
release(): void;
autorelease(): this;
retainCount(): number;
readonly description: string;
readonly debugDescription: string;
copyWithZone(zone: interop.PointerConvertible): interop.Object;
name: string;
}