This file contains hidden or 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
function MyComponent({ isOpen }) { | |
if (!isOpen) return null; | |
const store = useContext(StoreContext); | |
// ... | |
} |
This file contains hidden or 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
declare module "finale-rest" { | |
import { Express, Request, Response, Router } from "express"; | |
import { Instance, Sequelize } from "sequelize"; | |
function initialize(options: InitializeOptions): Finale; | |
function resource(options: ResourceOptions): Resource; | |
interface Finale {} |
This file contains hidden or 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
declare module "epilogue" { | |
import { Express, Request, Response, Router } from "express"; | |
import { Instance, Sequelize } from "sequelize"; | |
function initialize(options: InitializeOptions): Epilogue; | |
function resource(options: ResourceOptions): Resource; | |
interface Epilogue {} |
This file contains hidden or 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
declare module "postgraphile" { | |
import { GraphQLError, ExecutionResult } from "graphql"; | |
import { Pool, PoolConfig } from "pg"; | |
import { IncomingMessage, ServerResponse, Server } from "http"; | |
import * as jwt from "jsonwebtoken"; | |
import { createPostGraphileSchema, watchPostGraphileSchema } from "postgraphile-core"; | |
export type mixed = {} | string | number | boolean | undefined | null; | |
export type PluginHookFn = <T>(hookName: string, argument: T, context?: {}) => T; | |
export type AddFlagFn = (optionString: string, description: string, parse?: (option: string) => mixed) => AddFlagFn; |
This file contains hidden or 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
declare module "postgraphile-core" { | |
import { Client, Pool } from "pg"; | |
import { Build, Context, Options, Plugin } from "graphile-build"; | |
type PostGraphileOptions = { | |
dynamicJson?: boolean; | |
classicIds?: boolean; | |
disableDefaultMutations?: string; | |
nodeIdFieldName?: string; | |
graphileBuildOptions?: Options; |
This file contains hidden or 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
// todo verify TypeScript's `[key: string]: any` is equivalent to flow's `[string]: mixed` | |
// todo verify TypeScript's Build & BuildExtensions is equivalent to flow's build: { ...Build, ...BuildExtensions } | |
declare module "graphile-build" { | |
import { GraphQLInterfaceType } from "graphql"; | |
import { EventEmitter } from "events"; | |
import { GraphQLResolveInfo, GraphQLType, GraphQLNamedType, GraphQLSchema } from "graphql"; | |
type TriggerChangeType = () => void; | |
export type WatchUnwatch = (triggerChange: TriggerChangeType) => void; |
This file contains hidden or 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 type AccountState = | |
"Active" | | |
"RegisteredPendingEmailValidation" | | |
"RegisteredPendingAdminApproval" | | |
"PasswordResetPendingEmailValidation" | | |
"EmailChangedPendingValidation"; |
This file contains hidden or 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
public interface IModelValidationResult | |
{ | |
public IEnumerable<ModelValidationError> ModelErrors { get; set; } | |
// one error per pair/group of properties -> show ModelErrorMesssage in error summary list | |
public IDictionary<string, ModelValidationError> PropertyErrors { get; set; } | |
// on error per property -> turn property red and show PropertyErrorMessage next to property | |
// note: would include only the *first* error encountered for each property | |
public IDictionary<string, IList<ModelValidationError>> GroupedPropertyErrors { get; set; } |
This file contains hidden or 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
public HtmlWizard GetWelcomeView | |
{ | |
var model = new { Features = new[] { "Easy to type", "Easy to read", "Easy to maintain" } }; | |
return new HtmlWizard((e /* element */, a /* attribute */, ca /* custom attribute */) => | |
{ | |
e.Html( | |
e.Head( | |
e.Title("Check out ", e.Strong("HTML Wizard"), "!")), | |
e.Body( |