diff --git a/Source/StringFilr.d.ts b/Source/StringFilr.d.ts new file mode 100644 index 0000000..d6fe0f3 --- /dev/null +++ b/Source/StringFilr.d.ts @@ -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; + } +} \ No newline at end of file diff --git a/Source/StringFilr.ts b/Source/StringFilr.ts index 073b79c..086a5ab 100644 --- a/Source/StringFilr.ts +++ b/Source/StringFilr.ts @@ -1,18 +1,8 @@ +/// + 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" */ - 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)) {