or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

arrays.mdassertions.mdcore.mddom.mdevents.mdindex.mdmath.mdobjects.mdstrings.md
tile.json

core.mddocs/

Core Foundation

The core foundation provides the fundamental module system, object utilities, type checking, and class inheritance system that powers the entire Google Closure Library.

Capabilities

Module System

The backbone of the Closure Library dependency management system.

/**
 * Declares that a file provides a namespace
 * @param {string} name - The namespace being provided
 */
goog.provide = function(name) {};

/**
 * Declares a dependency on another module
 * @param {string} name - The namespace being required
 */
goog.require = function(name) {};

/**
 * Declares an ES6-style module
 * @param {string} name - The module name
 */
goog.module = function(name) {};

/**
 * Gets a module by ID
 * @param {string} id - The module ID
 * @return {*} The module
 */
goog.module.get = function(id) {};

/**
 * Declares a module ID for ES6 modules
 * @param {string} id - The module ID
 */
goog.declareModuleId = function(id) {};

/**
 * Declares legacy namespace for ES6 modules
 */
goog.module.declareLegacyNamespace = function() {};

/**
 * Declares type-only dependency (for type annotations)
 * @param {string} namespace - The namespace being required for types only
 */
goog.requireType = function(namespace) {};

/**
 * Forward declares a namespace to avoid circular dependencies
 * @param {string} name - The namespace being forward declared
 */
goog.forwardDeclare = function(name) {};

Configuration System

Compile-time and runtime configuration management.

/**
 * Defines a compile-time constant that can be overridden
 * @param {string} name - The constant name
 * @param {T} defaultValue - The default value
 * @return {T} The defined value
 * @template T
 */
goog.define = function(name, defaultValue) {};

/**
 * Debug mode flag - can be overridden at compile time
 * @type {boolean}
 */
goog.DEBUG;

/**
 * Current locale string
 * @type {string}
 */
goog.LOCALE;

/**
 * Trusted site flag for security features
 * @type {boolean}
 */
goog.TRUSTED_SITE;

/**
 * Browser feature set year baseline
 * @type {number}
 */
goog.FEATURESET_YEAR;

/**
 * Reference to the global object
 * @type {!Global}
 */
goog.global;

/**
 * Base path for script loading
 * @type {string}
 */
goog.basePath;

/**
 * Module type enumeration
 * @enum {string}
 */
goog.ModuleType;

Type Checking System

Runtime type checking utilities available in base.js.

/**
 * Gets the type of a value (more comprehensive than typeof)
 * @param {*} value - Value to get type of
 * @return {string} The type name
 */
goog.typeOf = function(value) {};

/**
 * Tests if a value is an object (not null)
 * @param {*} val - Value to test
 * @return {boolean} True if object and not null
 */
goog.isObject = function(val) {};

/**
 * Tests if a value is array-like (has length property)
 * @param {*} val - Value to test
 * @return {boolean} True if array-like
 */
goog.isArrayLike = function(val) {};

/**
 * Tests if a value is date-like (has getFullYear method)
 * @param {*} val - Value to test
 * @return {boolean} True if date-like
 */
goog.isDateLike = function(val) {};

Object Identity System

Unique ID management and object utilities.

/**
 * Gets a unique ID for an object
 * @param {Object} obj - Object to get ID for
 * @return {number} Unique ID
 */
goog.getUid = function(obj) {};

/**
 * Tests if an object has a unique ID
 * @param {Object} obj - Object to test
 * @return {boolean} True if has unique ID
 */
goog.hasUid = function(obj) {};

/**
 * Removes the unique ID from an object
 * @param {Object} obj - Object to remove ID from
 */
goog.removeUid = function(obj) {};

/**
 * Shallow clones an object
 * @param {Object} obj - Object to clone
 * @return {Object} Cloned object
 */
goog.cloneObject = function(obj) {};

/**
 * Gets an object by name from a namespace path
 * @param {string} name - Dot-separated object path
 * @param {Object=} opt_obj - Root object (default: global)
 * @return {*} The found object or undefined
 */
goog.getObjectByName = function(name, opt_obj) {};

Class System

Inheritance and object-oriented programming utilities.

/**
 * Sets up inheritance between constructor functions
 * @param {Function} childCtor - Child constructor
 * @param {Function} parentCtor - Parent constructor
 */
goog.inherits = function(childCtor, parentCtor) {};

/**
 * Binds a function to an object and optionally pre-fills arguments
 * @param {Function} fn - Function to bind
 * @param {Object} selfObj - Object to bind to
 * @param {...*} var_args - Arguments to pre-fill
 * @return {Function} Bound function
 */
goog.bind = function(fn, selfObj, var_args) {};

/**
 * Partially applies arguments to a function
 * @param {Function} fn - Function to partially apply
 * @param {...*} var_args - Arguments to pre-fill
 * @return {Function} Partially applied function
 */
goog.partial = function(fn, var_args) {};

/**
 * Defines a class using an object literal approach
 * @param {Function} superClass - Super class constructor
 * @param {Object} def - Class definition object
 * @return {Function} The class constructor
 */
goog.defineClass = function(superClass, def) {};

/**
 * Provides a scoped environment for code execution
 * @param {Function} fn - Function to execute in scope
 */
goog.scope = function(fn) {};

/**
 * Marks code as test-only (removed in production builds)
 * @param {string=} opt_message - Optional test-only message
 */
goog.setTestOnly = function(opt_message) {};

/**
 * Throws an error indicating an abstract method was called
 * @throws {Error}
 */
goog.abstractMethod = function() {};

/**
 * Adds a getInstance method to a constructor for singleton pattern
 * @param {Function} ctor - Constructor function
 */
goog.addSingletonGetter = function(ctor) {};

Global Utilities

Symbol export and utility functions.

/**
 * Exports a symbol to the global scope
 * @param {string} publicPath - Public path for the symbol
 * @param {*} object - Object to export
 * @param {Object=} objectToExportTo - Target object (defaults to global)
 */
goog.exportSymbol = function(publicPath, object, objectToExportTo) {};

/**
 * Exports a property on an object
 * @param {Object} object - Object to export property on
 * @param {string} publicName - Public name for the property
 * @param {*} symbol - Symbol to export
 */
goog.exportProperty = function(object, publicName, symbol) {};

/**
 * Returns current timestamp in milliseconds
 * @return {number} Current time in milliseconds
 */
goog.now = function() {};

/**
 * Evaluates JavaScript code in global context
 * @param {string} script - JavaScript code to evaluate
 * @return {*} Result of evaluation
 */
goog.globalEval = function(script) {};

CSS and Internationalization

CSS name obfuscation and internationalization utilities.

/**
 * Gets CSS class name with optional modifier, handles obfuscation
 * @param {string} className - Base CSS class name
 * @param {string=} opt_modifier - Optional modifier string
 * @return {string} CSS class name (possibly obfuscated)
 */
goog.getCssName = function(className, opt_modifier) {};

/**
 * Sets CSS name mapping for obfuscation
 * @param {Object} mapping - Mapping object from original to obfuscated names
 * @param {string=} opt_style - Mapping style ('BY_WHOLE' or 'BY_PART')
 */
goog.setCssNameMapping = function(mapping, opt_style) {};

/**
 * Gets localized message with optional placeholder values
 * @param {string} str - Message template with placeholders
 * @param {Object=} opt_values - Values for placeholders
 * @param {Object=} opt_options - Formatting options
 * @return {string} Localized message
 */
goog.getMsg = function(str, opt_values, opt_options) {};

/**
 * Gets localized message with fallback
 * @param {string} a - Primary message
 * @param {string} b - Fallback message  
 * @return {string} Localized message
 */
goog.getMsgWithFallback = function(a, b) {};

Module Loading and Dependencies

Advanced module loading and dependency management.

/**
 * Loads a module using provided module definition
 * @param {string} moduleDef - Module definition string
 */
goog.loadModule = function(moduleDef) {};

/**
 * Adds dependency information for a file
 * @param {string} relPath - Relative path to file
 * @param {Array<string>} provides - Namespaces provided by file
 * @param {Array<string>} requires - Namespaces required by file
 * @param {Object=} opt_loadFlags - Loading flags
 */
goog.addDependency = function(relPath, provides, requires, opt_loadFlags) {};

Security

Trusted Types and security utilities.

/**
 * Creates a Trusted Types policy for CSP compatibility
 * @param {string} name - Policy name
 * @return {*} Trusted Types policy object
 */
goog.createTrustedTypesPolicy = function(name) {};

Usage Examples:

// Module system usage
goog.provide('my.namespace.MyClass');
goog.require('goog.dom');

// Type checking
if (goog.isString(userInput)) {
    console.log('Input is a string:', userInput.length);
}

// Class inheritance
function Parent() {}
function Child() {
    Parent.call(this);
}
goog.inherits(Child, Parent);

// Function binding
var boundFunction = goog.bind(this.method, this, arg1, arg2);

// Configuration
goog.define('MY_APP.DEBUG_ENABLED', true);