You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
goog.module('hr.util.TriState');goog.module.declareLegacyNamespace();/** * Representation of a tri-state boolean. * @enum {string} */exports={UNKNOWN: 'UNKNOWN',FALSE: 'FALSE',TRUE: 'TRUE',};/** * Converts a boolean into a TriState enum. * @param {boolean} bool * @return {!TriState} */exports.fromBool=function(bool){returnbool ? TriState.TRUE : TriState.FALSE;};
TS:
declarenamespaceಠ_ಠ.clutz.hr.util{/** * Representation of a tri-state boolean. */enumTriState{FALSE='FALSE',TRUE='TRUE',UNKNOWN='UNKNOWN',}}declare module 'goog:hr.util.TriState'{importTriState=ಠ_ಠ.clutz.hr.util.TriState;exportdefaultTriState;}
The correct way to emit this is via namespace merging:
JS:
TS:
The correct way to emit this is via namespace merging:
http://www.typescriptlang.org/play/#src=%2F**%0D%0A%20*%20Representation%20of%20a%20tri-state%20boolean.%0D%0A%20*%2F%0D%0Aenum%20TriState%20%7B%0D%0A%20%20%20%20FALSE%20%3D%20'FALSE'%20%2C%0D%0A%20%20%20%20TRUE%20%3D%20'TRUE'%20%2C%0D%0A%20%20%20%20UNKNOWN%20%3D%20'UNKNOWN'%20%2C%0D%0A%7D%0D%0A%0D%0Anamespace%20TriState%20%7B%0D%0A%20%20%20%20export%20function%20fromBool(bool%3A%20boolean)%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20bool%20%3F%20TriState.TRUE%20%3A%20TriState.FALSE%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Aconst%20x%20%3D%20TriState.fromBool(true)%3B%0D%0A
The text was updated successfully, but these errors were encountered: