Skip to content

Instantly share code, notes, and snippets.

@r37r0m0d3l
Last active June 26, 2020 17:43
Show Gist options
  • Select an option

  • Save r37r0m0d3l/f94d248101c5029fd12a16cb4cc65612 to your computer and use it in GitHub Desktop.

Select an option

Save r37r0m0d3l/f94d248101c5029fd12a16cb4cc65612 to your computer and use it in GitHub Desktop.
class WebElement {
public x: number;
public y: number;
// More code here
}
class EditorPaneElement {
public static getHumanReadableCoordinates(element: WebElement) {
return `[x:${element.x},y:${element.y}]`;
}
// More code here
}
class WebHelper {
protected static parseInvalidJSON(invalidJSON): { [key: string]: any } {
// Return "fixed" JSON.
// Not used anywhere except this class.
return {};
}
protected static getNetworkStatus(): boolean {
// TRUE if online status is 100% guaranteed.
// Not used anywhere except this class.
// No need to be an instance method.
return true;
}
// More code here
}
class CombineConfiguration {
public static async getConfigFromYAML(uri: string | Buffer | URL): Promise<{ [key: string]: any }> {
// Parse YAML
return {};
}
public static async getConfigFromXML(uri: string | Buffer | URL): Promise<{ [key: string]: any }> {
// Parse XML
return {};
}
public static async getConfigFromJSON(uri: string | Buffer | URL): Promise<{ [key: string]: any }> {
// Parse JSON
return {};
}
public async getConfiguration(uris: string | Buffer | URL): Promise<Array<{ [key: string]: any }>> {
// this.somethng();
return [{}, {}];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment