-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
define global externs for ReadonlyMap.
FUTURE_COPYBARA_INTEGRATE_REVIEW=TGP PiperOrigin-RevId: 541706571
- Loading branch information
1 parent
7c15472
commit 3c6c7ef
Showing
9 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Opaque value type that represents big integer values regardless of native | ||
* platform support for `bigint`. See go/gbigint for more info. | ||
*/ | ||
interface gbigint { | ||
readonly __doNotManuallySet: unique symbol; | ||
|
||
valueOf(): gbigint; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @fileoverview added by tsickle | ||
* Generated from: test_files/gbigint/exports_gbigint.ts | ||
*/ | ||
goog.module('test_files.gbigint.exports_gbigint'); | ||
var module = module || { id: 'test_files/gbigint/exports_gbigint.ts' }; | ||
goog.require('tslib'); | ||
/** | ||
* @param {string} val | ||
* @return {!gbigint} | ||
*/ | ||
function toGbigint(val) { | ||
return (/** @type {!gbigint} */ ((/** @type {*} */ (val)))); | ||
} | ||
/** | ||
* A `gbigint` value on an exported variable. | ||
* @type {!gbigint} | ||
*/ | ||
exports.myGbigint = toGbigint('0'); | ||
/** | ||
* A `gbigint` value on a param type. | ||
* @param {!gbigint} val | ||
* @return {void} | ||
*/ | ||
function takeGbigint(val) { | ||
console.log(val); | ||
} | ||
exports.takeGbigint = takeGbigint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function toGbigint(val: string): gbigint { | ||
return val as unknown as gbigint; | ||
} | ||
|
||
/** A `gbigint` value on an exported variable. */ | ||
export const myGbigint: gbigint = toGbigint('0'); | ||
|
||
/** A `gbigint` value on a param type. */ | ||
export function takeGbigint(val: gbigint): void { | ||
console.log(val); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* When gbigint is made globally available, this file will be | ||
* deleted as the typings here will move to a global location. At this moment, | ||
* the proposed location is: | ||
* google3/javascript/externs/google_legacy.js | ||
* @externs | ||
*/ | ||
|
||
/** | ||
* See go/gbigint. | ||
* | ||
* Opaque value type that represents `bigint` values regardless of native | ||
* platform support for `bigint`. As value types, they have a guaranteed | ||
* consistent runtime representation compatible with `===`, ES6 `Map` keys and | ||
* `Set` values. | ||
* @interface | ||
*/ | ||
function gbigint() {} | ||
|
||
/** @const {symbol} */ | ||
gbigint.prototype.__doNotManuallySet; |