This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.
Externs aren't generated for type aliases of records #510
Open
Description
The Google Maps typings file declares two types as:
export type LatLngLiteral = { lat: number; lng: number }
export type LatLngBoundsLiteral = { east: number; north: number; south: number; west: number }
tsickle then produces this in the externs file:
/** @typedef {?} */
google.maps.LatLngLiteral;
/** @typedef {?} */
google.maps.LatLngBoundsLiteral;
That causes the fields in these two types to be obfuscated by the Closure compiler.
However, if I change the typings file like so:
export interface LatLngLiteral { lat: number; lng: number }
export interface LatLngBoundsLiteral { east: number; north: number; south: number; west: number }
tsickle then produces this in the externs file:
/** @record @struct */
google.maps.LatLngLiteral = function() {};
/** @type {?} */
google.maps.LatLngLiteral.prototype.lat;
/** @type {?} */
google.maps.LatLngLiteral.prototype.lng;
/** @record @struct */
google.maps.LatLngBoundsLiteral = function() {};
/** @type {?} */
google.maps.LatLngBoundsLiteral.prototype.east;
/** @type {?} */
google.maps.LatLngBoundsLiteral.prototype.north;
/** @type {?} */
google.maps.LatLngBoundsLiteral.prototype.south;
/** @type {?} */
google.maps.LatLngBoundsLiteral.prototype.west;
This prevents the field names from becoming obfuscated.
Metadata
Metadata
Assignees
Labels
No labels