Skip to content

Commit

Permalink
Translate "?" from "| null" into "null | undefined"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiawei-Shao committed Dec 17, 2024
1 parent 8a75a9d commit c3564eb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Most or all of these should be fixed in the generator over time.
- `Array` changed to `Iterable` for WebIDL `sequence`s in argument positions (but not in return positions).
- `any` changed to `object` for WebIDL `object`.
- `| SharedArrayBuffer` added for `[AllowShared] BufferSource`.
- `| null` changed to `| null | undefined` for WebIDL `?` items in `sequence`s.

The following differences are TODO: should be changed in the final result.

Expand Down
32 changes: 27 additions & 5 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ interface GPUCanvasConfiguration {
/**
* The tone mapping determines how the content of textures returned by
* {@link GPUCanvasContext#getCurrentTexture} are to be displayed.
* Note: If an implementation doesn't support HDR WebGPU canvases, it should also not expose this member, to allow for feature detection. See {@link GPUCanvasContext#getConfiguration}.
*/
toneMapping?: GPUCanvasToneMapping;
/**
Expand Down Expand Up @@ -927,7 +928,11 @@ interface GPUFragmentState
* A list of {@link GPUColorTargetState} defining the formats and behaviors of the color targets
* this pipeline writes to.
*/
targets: Iterable<GPUColorTargetState | null>;
targets: Iterable<
| GPUColorTargetState
| null
| undefined
>;
}

interface GPUMultisampleState {
Expand Down Expand Up @@ -991,7 +996,11 @@ interface GPUPipelineLayoutDescriptor
* to a @group attribute in the {@link GPUShaderModule}, with the `N`th element corresponding
* with `@group(N)`.
*/
bindGroupLayouts: Iterable<GPUBindGroupLayout | null>;
bindGroupLayouts: Iterable<
| GPUBindGroupLayout
| null
| undefined
>;
}

interface GPUPrimitiveState {
Expand Down Expand Up @@ -1202,7 +1211,11 @@ interface GPURenderPassDescriptor
* Due to compatible usage list|usage compatibility, no color attachment
* may alias another attachment or any resource used inside the render pass.
*/
colorAttachments: Iterable<GPURenderPassColorAttachment | null>;
colorAttachments: Iterable<
| GPURenderPassColorAttachment
| null
| undefined
>;
/**
* The {@link GPURenderPassDepthStencilAttachment} value that defines the depth/stencil
* attachment that will be output to and tested against when executing this render pass.
Expand Down Expand Up @@ -1231,7 +1244,11 @@ interface GPURenderPassLayout
/**
* A list of the {@link GPUTextureFormat}s of the color attachments for this pass or bundle.
*/
colorFormats: Iterable<GPUTextureFormat | null>;
colorFormats: Iterable<
| GPUTextureFormat
| null
| undefined
>;
/**
* The {@link GPUTextureFormat} of the depth/stencil attachment for this pass or bundle.
*/
Expand Down Expand Up @@ -1329,6 +1346,7 @@ interface GPURequestAdapterOptions {
* attribute prior to requesting a {@link GPUDevice}.
*/
forceFallbackAdapter?: boolean;
xrCompatible?: boolean;
}

interface GPUSamplerBindingLayout {
Expand Down Expand Up @@ -1690,7 +1708,11 @@ interface GPUVertexState
* A list of {@link GPUVertexBufferLayout}s, each defining the layout of vertex attribute data in a
* vertex buffer used by this pipeline.
*/
buffers?: Iterable<GPUVertexBufferLayout | null>;
buffers?: Iterable<
| GPUVertexBufferLayout
| null
| undefined
>;
}

interface GPUBindingCommandsMixin {
Expand Down
2 changes: 2 additions & 0 deletions generated/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ interface GPUCanvasConfiguration {
/**
* The tone mapping determines how the content of textures returned by
* {@link GPUCanvasContext#getCurrentTexture} are to be displayed.
* Note: If an implementation doesn't support HDR WebGPU canvases, it should also not expose this member, to allow for feature detection. See {@link GPUCanvasContext#getConfiguration}.
*/
toneMapping?: GPUCanvasToneMapping;
/**
Expand Down Expand Up @@ -1274,6 +1275,7 @@ interface GPURequestAdapterOptions {
featureLevel?: string;
powerPreference?: GPUPowerPreference;
forceFallbackAdapter?: boolean;
xrCompatible?: boolean;
}

interface GPUSamplerBindingLayout {
Expand Down

0 comments on commit c3564eb

Please sign in to comment.