Skip to content

Instantly share code, notes, and snippets.

@kepek
Last active September 5, 2018 06:19
Show Gist options
  • Save kepek/1507c6ea0f63971d95ca1d27cf310ed1 to your computer and use it in GitHub Desktop.
Save kepek/1507c6ea0f63971d95ca1d27cf310ed1 to your computer and use it in GitHub Desktop.
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