Separated into StringFilr.d.ts with IStringFilr

This commit is contained in:
Josh Goldberg
2015-06-08 16:00:24 -04:00
parent 783795ceee
commit d01bc17da6
2 changed files with 27 additions and 14 deletions
+23
View File
@@ -0,0 +1,23 @@
declare module StringFilr {
export interface IStringFilrSettings {
// An Object containing data stored as children of sub-Objects.
library: any;
// A String to use as a default key to rescue on, if provided.
normal?: string;
// Whether it's ok for the library to have Objects that don't contain the
// normal key (by default, false).
requireNormalKey?: boolean;
}
export interface IStringFilr {
getLibrary(): any;
getNormal(): string;
getCache(): any;
getCached(key: string): any;
clearCache(): void;
clearCached(key: string): void;
get(keyRaw: string): any;
}
}
+4 -14
View File
@@ -1,18 +1,8 @@
/// <reference path="StringFilr.d.ts" />
module StringFilr {
"use strict";
export interface IStringFilrSettings {
// An Object containing data stored as children of sub-Objects.
library: any;
// A String to use as a default key to rescue on, if provided.
normal?: string;
// Whether it's ok for the library to have Objects that don't contain the
// normal key (by default, false).
requireNormalKey?: boolean;
}
/**
* A general utility for retrieving data from an Object based on nested class
* names. You can think of the internal "library" Object as a tree structure,
@@ -21,7 +11,7 @@ module StringFilr {
*
* @author "Josh Goldberg" <josh@fullscreenmario.com>
*/
export class StringFilr {
export class StringFilr implements IStringFilr {
// The library of data.
private library: any;
@@ -152,7 +142,7 @@ module StringFilr {
* don't have a matching key.
* @return {String[]} output
*/
findLackingNormal(current: any, path: string, output: string[]): string[] {
private findLackingNormal(current: any, path: string, output: string[]): string[] {
var i: string;
if (!current.hasOwnProperty(this.normal)) {