Last active
September 5, 2018 06:19
-
-
Save kepek/1507c6ea0f63971d95ca1d27cf310ed1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IStringTMap<T> { | |
[key: string]: T; | |
} | |
export class COptions<TProperties> { | |
constructor(properties?: TProperties) { | |
if (properties) { | |
for (let propertyName in properties) { | |
if (properties.hasOwnProperty(propertyName)) { | |
Object.defineProperty(this, propertyName, { | |
value: properties[propertyName], | |
writable: true, | |
enumerable: true | |
}); | |
} | |
} | |
} | |
} | |
} | |
export interface IImageZoomOptions extends IStringTMap<any> { | |
zoomBy?: number; | |
maxZoomLevel?: number; | |
initialZoomLevel?: number; | |
} | |
export class ImageZoomOptions extends COptions<IImageZoomOptions> | |
implements IImageZoomOptions { | |
public initialZoomLevel: number = 1; | |
public maxZoomLevel: number = 3; | |
public zoomBy: number = 0.1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment