sush
Version:
Core module for SUSH
40 lines (39 loc) • 961 B
TypeScript
/**
* `StockConfig` is config for `Stock` of SUSH.
*/
export interface StockConfig {
/**
* `mode` is mode of `Stock`.
* - `'default'`
* - Same as Map.
* - `'upper'`
* - Upper-case keys.
* - `'lower'`
* - Lower-case keys.
*/
mode: 'default' | 'upper' | 'lower';
}
/**
* `Stock` is key/value map for SUSH.
*/
export default class Stock extends Map<string, string> {
/** See `StockConfig`. */
mode: string;
/**
* @param config See `StockConfig`.
*/
constructor(config?: StockConfig);
/**
* Returns the value associated to the key.
*/
get(key: string): string;
/**
* Sets the value for the key.
*/
set(key: string, value: string): this;
/**
* Returns a boolean asserting whether a value has been associated to the key or not.
*/
has(key: string): boolean;
private _convertKey(key);
}