Skip to content

Instantly share code, notes, and snippets.

View bermanboris's full-sized avatar
🎯
Hyper Focusing

Boris Berman bermanboris

🎯
Hyper Focusing
  • Earth
View GitHub Profile
@bermanboris
bermanboris / prettier-brower.js
Created June 3, 2018 18:04
Prettier in your browser!
import prettier from "prettier/standalone";
import path from "path";
const plugins = [
require("prettier/parser-graphql"),
require("prettier/parser-babylon")
];
const EXTENSION_TO_PARSER = {
ts: "typescript",
@bermanboris
bermanboris / typescript-create-service.ts
Created June 11, 2018 09:19
TypeScript 2018 - Create Service Example Code (with declarations)
export type ServiceDefinition = {
[x: string]: MethodDefinition;
};
export type MethodDefinition = {
[x: string]: StringConstructor | NumberConstructor;
};
export type ServiceObject<T extends ServiceDefinition> = {
[P in keyof T]: ServiceMethod<T[P]>