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
| const number = /(?:sbyte|ushort|short|uint|int|ulong|long|float|double|decimal|byte)/; | |
| const string = /(?:char|string)/; | |
| const bool = /(?:bool)/; | |
| const date = /(?:DateTime)/; | |
| let builder = { | |
| accessModifier: 'public', | |
| name: 'test', | |
| type: 'int' | |
| }; |
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
| | |
| type FunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T]; | |
| type rule<T> = {[key in FunctionPropertyNames<T>]?: T[key] extends (args: infer U) => void ? U : never}; | |
| | |
| class rules { | |
| ruleOne(args: {first: string, second: number}) { } | |
| } | |
| | |
| function ruleTwo(args: {first: number}) { } |
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 class Action<T> { | |
| _subject = new BehaviorSubject<T>(undefined); | |
| public get state() : T { | |
| return this._subject.getValue(); | |
| } | |
| public set state(v : T) { | |
| this._subject.next(v); |
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
| getCitation = this.ds.citation.getAllForProcedure.bind(this, pipe(Dispatch(this.store, this.getCitation), Spinner(this.store))); | |
| getCitations(procId: number): Observable<CitationBasic> { | |
| return this.httpGet( | |
| this.getCitations, | |
| '/inspections/api/action/Citation/GetAllForProcedure?procId=' + procId, | |
| x => new CitationBasic(x) | |
| ); | |
| } |
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 class Action<T> { | |
| _subject = new BehaviorSubject<T>(undefined); | |
| public get state() : T { | |
| return this._subject.getValue(); | |
| } | |
| public set state(v : T) { | |
| this._subject.next(v); |
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
| /* tslint:disable:no-unused-variable */ | |
| type booleanify<T> = { [P in keyof T]: boolean }; | |
| import { By } from '@angular/platform-browser'; | |
| import { DebugElement } from '@angular/core'; | |
| import { AppState, Store, dataReducer, DataActions, MiscActions } from '../../../cdux'; | |
| import { async, inject } from '@angular/core/testing'; | |
| import * as moment from 'moment'; | |
| import { ProcedureSchedulerComponent } from '../../../component/scheduleTools/procedureScheduler/procedureScheduler.component'; |
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 interface IActionable<T> { | |
| state: T; | |
| subject: BehaviorSubject<T>; | |
| } | |
| export class Action<T> { | |
| _subject = new BehaviorSubject<T>(undefined); | |
| public get state() : T { |
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
| type funcPropNames<T> = { | |
| [prop in keyof T]: T[prop] extends Function ? prop : never; | |
| }[keyof T]; | |
| | |
| type FunctionProps<T> = Pick<T, funcPropNames<T>>; | |
| | |
| export type Spied<T> = { | |
| [k in keyof T]: k extends FunctionProps<T> ? jasmine.Spy : T; | |
| }; | |
| |
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 Spied<T> = { | |
| [K in keyof T]: T[K] extends Function ? jasmine.Spy : T[K] extends object ? Spied<T[K]> : T[K]; | |
| }; | |
| export function spyOnClass<T, U1 extends unknown[]>(type: new (...tArg1: U1) => T, ...arg1: U1) { | |
| let spyOnFunctions = function <W>(obj: W): Spied<W> { | |
| Object.keys(obj).forEach(p => { | |
| if (!!obj && !arg1.some(a => obj[p] === a)) { | |
| if (obj[p] instanceof Function) { | |
| spyOn(obj, p as keyof W); |
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 ISendEmail<in T> | |
| { | |
| void SendEmail(T param); | |
| } | |
| public interface ISendInApp<in T> | |
| { | |
| void SendInApp(T param); | |
| } |
OlderNewer