Skip to content

MVTDataProvider: Fix generated type definitions#13616

Open
donmccurdy wants to merge 2 commits into
mainfrom
donmccurdy/fix/mvtdataprovider-fromurl-types
Open

MVTDataProvider: Fix generated type definitions#13616
donmccurdy wants to merge 2 commits into
mainfrom
donmccurdy/fix/mvtdataprovider-fromurl-types

Conversation

@donmccurdy

@donmccurdy donmccurdy commented Jul 9, 2026

Copy link
Copy Markdown
Member

Description

The type definitions for MVTDataProvider (generated from JSDoc by tsd-jsdoc) are currently incomplete. This PR fixes the type definitions, by adding missing @extends and @returns declarations.

It's easy to forget these declarations, especially since they aren't necessary for type checking — TypeScript already knows the return type and the class inheritance here. I've added a rule for ast-grep to warn when a publicly-documented class is missing JSDoc for its parent class.

Ideally we'd also have a rule to detect when methods are missing a required @returns tag, but I'm not sure what conditions require that, or how to detect it, yet. All public functions and methods? Perhaps all async functions need the tag, since otherwise tsd-jsdoc doesn't know they return a promise? The @async tag doesn't appear to be supported by tsd-jsdoc. In any case I've left that part out of scope for this PR.

Issue number and link

Testing plan

Diff of Cesium.d.ts:

diff --git a/Source/Cesium.main.d.ts b/Source/Cesium.d.ts
index 37c002e263..31d2e5cc64 100644
--- a/Source/Cesium.main.d.ts
+++ b/Source/Cesium.d.ts
@@ -37756,7 +37756,7 @@ export class Light {
  * This object is normally not instantiated directly, use {@link MVTDataProvider.fromUrl}.
  * </div>
  */
-export class MVTDataProvider {
+export class MVTDataProvider extends UrlTemplate3DTilesDataProvider {
     /**
      * Creates an MVTDataProvider from the specified URL template and options.
      * @param url - URL template, containing {z}, {x}, and {y} placeholders.
@@ -37771,7 +37771,7 @@ export class MVTDataProvider {
         maxZoom?: number;
         extent?: Rectangle;
         featureIdProperty?: string;
-    }): void;
+    }): Promise<MVTDataProvider>;
 }
 
 /**
@@ -45438,6 +45438,60 @@ export enum Tonemapper {
     PBR_NEUTRAL = "PBR_NEUTRAL"
 }
 
+/**
+ * Base provider for URL-template vector sources that are rendered through a
+ * runtime-generated 3D Tiles tileset.
+ * @param urlTemplate - URL template containing {z}, {x}, and {y} placeholders.
+ * @param [options] - Provider options.
+ * @param [options.minZoom = 0] - Minimum zoom level represented in the generated tileset.
+ * @param [options.maxZoom = 14] - Maximum zoom level represented in the generated tileset.
+ * @param [options.extent] - Optional geographic extent in radians to constrain the generated tile tree.
+ * @param [options.featureIdProperty] - Feature property name to use as feature ID when supported by content decoding.
+ */
+export class UrlTemplate3DTilesDataProvider {
+    constructor(urlTemplate: Resource | string, options?: {
+        minZoom?: number;
+        maxZoom?: number;
+        extent?: Rectangle;
+        featureIdProperty?: string;
+    });
+    /**
+     * Creates a provider from a URL template.
+     * @param url - URL template containing {z}, {x}, and {y} placeholders.
+     * @param [options] - Provider options.
+     */
+    static fromUrl(url: Resource | string, options?: any): Promise<UrlTemplate3DTilesDataProvider>;
+    /**
+     * URL template containing {z}/{x}/{y}.
+     */
+    readonly urlTemplate: string;
+    /**
+     * Resource derived from the URL template.
+     */
+    readonly resource: Resource;
+    /**
+     * Optional geographic extent in radians used to generate tile headers.
+     */
+    readonly extent: Rectangle | undefined;
+    /**
+     * Backing 3D Tileset.
+     */
+    readonly tileset: Cesium3DTileset | undefined;
+    /**
+     * Determines if the generated tileset is shown.
+     */
+    show: boolean;
+    protected _createRuntimeTilesetOptions(): void;
+    protected _createTilesetLoadOptions(): any;
+    protected _configureTileset(_tileset: Cesium3DTileset): void;
+    /**
+     * Subclasses must return a runtime content codec describing how to turn
+     * a downloaded tile payload into a {@link Cesium3DTileContent}. See
+     * {@link Cesium3DTileset#_runtimeContentCodec} for the expected shape.
+     */
+    protected _createCodec(): any;
+}
+
 export namespace UrlTemplateImageryProvider {
     /**
      * Initialization options for the UrlTemplateImageryProvider constructor

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

AI acknowledgment

  • I used AI to generate content in this PR
  • If yes, I have reviewed the AI-generated content before submitting

If yes, I used the following Tools(s) and/or Service(s):

If yes, I used the following Model(s):

PR Dependency Tree

This tree was auto-generated by Charcoal

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for the pull request, @donmccurdy!

✅ We can confirm we have a CLA on file for you.

@donmccurdy donmccurdy marked this pull request as ready for review July 9, 2026 13:31
@donmccurdy donmccurdy requested a review from danielzhong July 9, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant