Skip to content

fix(google-maps): resolve mismatching types #30544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,15 @@ export interface ClusterOptions {
markers?: Marker[];
}

export declare class Cluster {
export interface Cluster {
marker?: Marker;
readonly markers?: Marker[];
protected _position: google.maps.LatLng;
constructor({markers, position}: ClusterOptions);
get bounds(): google.maps.LatLngBounds | undefined;
get position(): google.maps.LatLng;
/**
* Get the count of **visible** markers.
*/
get count(): number;
/**
* Add a marker to the cluster.
*/
bounds?: google.maps.LatLngBounds;
position: google.maps.LatLng;
count: number;
push(marker: Marker): void;
/**
* Cleanup references and remove marker from map.
*/
delete(): void;
new (options: ClusterOptions): Cluster;
}

export declare class MarkerClusterer extends google.maps.OverlayView {
Expand Down Expand Up @@ -117,11 +107,11 @@ export interface Renderer {
render(cluster: Cluster, stats: ClusterStats, map: google.maps.Map): Marker;
}

export declare class ClusterStats {
readonly markers: {
export interface ClusterStats {
markers: {
sum: number;
};
readonly clusters: {
clusters: {
count: number;
markers: {
mean: number;
Expand All @@ -130,7 +120,7 @@ export declare class ClusterStats {
max: number;
};
};
constructor(markers: Marker[], clusters: Cluster[]);
new (markers: Marker[], clusters: Cluster[]): ClusterStats;
}

export interface Algorithm {
Expand Down
23 changes: 13 additions & 10 deletions tools/public_api_guard/google-maps/google-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@ export type AriaLabelFn = (text: string) => string;
export type Calculator = (markers: google.maps.Marker[], clusterIconStylesCount: number) => ClusterIconInfo;

// @public (undocumented)
export class Cluster {
constructor({ markers, position }: ClusterOptions);
export interface Cluster {
// (undocumented)
new (options: ClusterOptions): Cluster;
// (undocumented)
bounds?: google.maps.LatLngBounds;
// (undocumented)
count: number;
// (undocumented)
get bounds(): google.maps.LatLngBounds | undefined;
get count(): number;
delete(): void;
// (undocumented)
marker?: Marker;
// (undocumented)
readonly markers?: Marker[];
// (undocumented)
get position(): google.maps.LatLng;
position: google.maps.LatLng;
// (undocumented)
protected _position: google.maps.LatLng;
push(marker: Marker): void;
}

Expand Down Expand Up @@ -107,10 +109,11 @@ export interface ClusterOptions {
}

// @public (undocumented)
export class ClusterStats {
constructor(markers: Marker[], clusters: Cluster[]);
export interface ClusterStats {
// (undocumented)
new (markers: Marker[], clusters: Cluster[]): ClusterStats;
// (undocumented)
readonly clusters: {
clusters: {
count: number;
markers: {
mean: number;
Expand All @@ -120,7 +123,7 @@ export class ClusterStats {
};
};
// (undocumented)
readonly markers: {
markers: {
sum: number;
};
}
Expand Down
Loading