type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
InterfaceDeclaration
export interface Account { /** Bech32 account address */ readonly address: string; readonly balance: readonly Coin[]; readonly pubkey: PubKey | undefined; readonly accountNumber: number; readonly sequence: number; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
export interface BroadcastTxFailure { /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; readonly height: number; readonly code: number; readonly rawLog: string; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
export interface BroadcastTxSuccess { readonly logs: readonly Log[]; readonly rawLog: string; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; readonly data?: Uint8Array; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
export interface SearchByHeightQuery { readonly height: number; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
export interface SearchBySentFromOrToQuery { readonly sentFromOrTo: string; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
/** * This query type allows you to pass arbitrary key/value pairs to the backend. It is * more powerful and slightly lower level than the other search options. */ export interface SearchByTagsQuery { readonly tags: ReadonlyArray<{ readonly key: string; readonly value: string }>; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
export interface SearchTxFilter { readonly minHeight?: number; readonly maxHeight?: number; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
/** A transaction that is indexed as part of the transaction history */ export interface IndexedTx { readonly height: number; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly hash: string; /** Transaction execution error code. 0 on success. */ reado...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
export interface BlockHeader { readonly version: { readonly block: string; readonly app: string; }; readonly height: number; readonly chainId: string; /** An RFC 3339 time string like e.g. '2020-02-15T10:39:10.4696305Z' */ readonly time: string; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
export interface Block { /** The ID is a hash of the block header (uppercase hex) */ readonly id: string; readonly header: BlockHeader; /** Array of raw transactions */ readonly txs: readonly Uint8Array[]; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
InterfaceDeclaration
/** Use for testing only */ export interface PrivateCosmosClient { readonly lcdClient: LcdClient & AuthExtension; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
TypeAliasDeclaration
export type BroadcastTxResult = BroadcastTxSuccess | BroadcastTxFailure;
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
TypeAliasDeclaration
export type SearchTxQuery = SearchByHeightQuery | SearchBySentFromOrToQuery | SearchByTagsQuery;
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
public async getChainId(): Promise<string> { if (!this.chainId) { const response = await this.lcdClient.nodeInfo(); const chainId = response.node_info.network; if (!chainId) throw new Error("Chain ID must not be empty"); this.chainId = chainId; } return this.chainId; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
public async getHeight(): Promise<number> { if (this.anyValidAddress) { const { height } = await this.lcdClient.auth.account(this.anyValidAddress); return parseInt(height, 10); } else { // Note: this gets inefficient when blocks contain a lot of transactions since it // requires downloa...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
/** * Returns a 32 byte upper-case hex transaction hash (typically used as the transaction ID) */ public async getIdentifier(tx: WrappedStdTx): Promise<string> { // We consult the REST API because we don't have a local amino encoder const response = await this.lcdClient.encodeTx(tx); const hash = sha2...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
/** * Returns account number and sequence. * * Throws if the account does not exist on chain. * * @param address returns data for this address. When unset, the client's sender adddress is used. */ public async getSequence(address: string): Promise<GetSequenceResult> { const account = await this.ge...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
public async getAccount(address: string): Promise<Account | undefined> { const account = await this.lcdClient.auth.account(address); const value = account.result.value; if (value.address === "") { return undefined; } else { this.anyValidAddress = value.address; return { addres...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
/** * Gets block header and meta * * @param height The height of the block. If undefined, the latest height is used. */ public async getBlock(height?: number): Promise<Block> { const response = height !== undefined ? await this.lcdClient.blocks(height) : await this.lcdClient.blocksLatest(); r...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
public async getTx(id: string): Promise<IndexedTx | null> { const results = await this.txsQuery(`tx.hash=${id}`); return results[0] ?? null; }
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
public async searchTx(query: SearchTxQuery, filter: SearchTxFilter = {}): Promise<readonly IndexedTx[]> { const minHeight = filter.minHeight || 0; const maxHeight = filter.maxHeight || Number.MAX_SAFE_INTEGER; if (maxHeight < minHeight) return []; // optional optimization function withFilters(origina...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
public async broadcastTx(tx: StdTx): Promise<BroadcastTxResult> { const result = await this.lcdClient.broadcastTx(tx); if (!result.txhash.match(/^([0-9A-F][0-9A-F])+$/)) { throw new Error("Received ill-formatted txhash. Must be non-empty upper-case hex"); } return result.code !== undefined ...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
MethodDeclaration
private async txsQuery(query: string): Promise<readonly IndexedTx[]> { // TODO: we need proper pagination support const limit = 100; const result = await this.lcdClient.txsQuery(`${query}&limit=${limit}`); const pages = parseInt(result.page_total, 10); if (pages > 1) { throw new Error( ...
public-awesome/cosmjs
packages/launchpad/src/cosmosclient.ts
TypeScript
ArrowFunction
(Happy) => { Happy.prototype.render = function(vdom: Array<IVnode>) { if (!vdom) return warn('dom列表为空'); vdom.forEach(elem => { this.createCommonElement(elem); if (elem.children.length) { this.render(elem.children); } }); }; Happy.prototype.createCommonElement = function(vd...
ShownBreak/happy
src/core/render.ts
TypeScript
ArrowFunction
elem => { this.createCommonElement(elem); if (elem.children.length) { this.render(elem.children); } }
ShownBreak/happy
src/core/render.ts
TypeScript
ArrowFunction
(e) => { e.stopPropagation(); this.currentMoveableId = attr.id; }
ShownBreak/happy
src/core/render.ts
TypeScript
ArrowFunction
(target: HTMLElement, attr: object) => { Object.keys(attr).forEach(key => { if (key === 'style') { target.setAttribute(key, convertJsontoStyle(attr[key], ';')); } else { target.setAttribute(key, attr[key]); } }); }
ShownBreak/happy
src/core/render.ts
TypeScript
ArrowFunction
key => { if (key === 'style') { target.setAttribute(key, convertJsontoStyle(attr[key], ';')); } else { target.setAttribute(key, attr[key]); } }
ShownBreak/happy
src/core/render.ts
TypeScript
InterfaceDeclaration
export interface ITransaction { _id?: string; status: string; paymentTerm: string; items: IItems[]; customer: { name: string; }; total: number; organization?: { name: string; }; transactionNumber?: number; transactionCode?: string; }
Jitu-Niagra/coreui-free-angular-admin-template
src/app/modules/sales/models/transaction.model.ts
TypeScript
ArrowFunction
() => { let grid: IGrid; let gridConfig: IGridConfig; let chart: Chart; let plugin: InteractionLinePlugin; beforeEach(() => { grid = new XYGrid(); gridConfig = new XYGridConfig(); chart = new Chart(grid); plugin = new InteractionLinePlugin(); (<any>plugin...
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { grid = new XYGrid(); gridConfig = new XYGridConfig(); chart = new Chart(grid); plugin = new InteractionLinePlugin(); (<any>plugin).isChartInView = true; chart.addPlugin(plugin); const element = document.createElement("div"); chart.build(elemen...
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { it("should not trigger a line update if the chart is not in view", () => { const valuesPayload: IInteractionValuesPayload = { interactionType: InteractionType.MouseMove, values: {}, }; const spy = spyOn((<any>plugin), "handleLineUpda...
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { const valuesPayload: IInteractionValuesPayload = { interactionType: InteractionType.MouseMove, values: {}, }; const spy = spyOn((<any>plugin), "handleLineUpdate"); (<any>plugin).isChartInView = false; chart.getEventBu...
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { const valuesPayload: IInteractionValuesPayload = { interactionType: InteractionType.MouseMove, values: {}, }; const spy = spyOn((<any>plugin), "handleLineUpdate"); (<any>plugin).isChartInView = true; chart.getEventBus...
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { const expectedStoredPayload: IInteractionValuesPayload = { interactionType: InteractionType.MouseMove, values: {}, }; chart.getEventBus().getStream(INTERACTION_VALUES_EVENT).next({ data: expectedStoredPayload }); expect((<any>plu...
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { it("should update the view status", () => { (<any>plugin).isChartInView = true; chart.getEventBus().getStream(CHART_VIEW_STATUS_EVENT).next({ data: { isChartInView: false } }); expect((<any>plugin).isChartInView).toEqual(false); }); it("should tri...
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { (<any>plugin).isChartInView = true; chart.getEventBus().getStream(CHART_VIEW_STATUS_EVENT).next({ data: { isChartInView: false } }); expect((<any>plugin).isChartInView).toEqual(false); }
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
ArrowFunction
() => { (<any>plugin).lastInteractionValuesPayload = { interactionType: InteractionType.MouseMove, values: {}, }; const spy = spyOn((<any>plugin), "handleLineUpdate"); (<any>plugin).isChartInView = false; chart.getEventBus()....
ewok-janitor-external/nova
packages/charts/src/core/plugins/interaction/interaction-line-plugin.spec.ts
TypeScript
EnumDeclaration
/** * 采购订单状态 */ export enum PurchaseOrderStatus { /** * 已作废 */ Obsolete = -1, /** * 草稿 */ Draft = 0, /** * 正常状态 */ Normal = 1, /** * 部分入库 */ PartialPurchaseIn = 2, /** * 全部入库 */ AllPurchaseIn = 3, /** * 部分出库 ...
lanyusteffen/Erp
src/app/modules/purchases/enums/purchase.status.public.ts
TypeScript
FunctionDeclaration
function setup(hasSubscriber: boolean) { const container = DI.createContainer(); const changeSet = <IChangeSet>container.get(IChangeSet); const observerLocator = <IObserverLocator>container.get(IObserverLocator); const el = <HTMLInputElement>createElement(`<input type="${inputType}"/>`...
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
FunctionDeclaration
function tearDown({ sut, changeSet, el }: Partial<ReturnType<typeof setup>>) { document.body.removeChild(el); sut.dispose(); }
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
FunctionDeclaration
function setup() { const container = DI.createContainer(); const observerLocator = <IObserverLocator>container.get(IObserverLocator); const el = <HTMLInputElement>createElement(`<input type="${inputType}"/>`); document.body.appendChild(el); const sut = <ValueAttributeObserver>...
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
FunctionDeclaration
function tearDown({ sut, el }: Partial<ReturnType<typeof setup>>) { document.body.removeChild(el); sut.dispose(); }
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
ArrowFunction
() => { const eventDefaults = { bubbles: true }; // TODO: these input types don't behave consistently due to their various constraints. // These need to be discussed and probably need specific logic for them to work predictably const inputTypeArr = ['color', 'date', 'datetime-local', 'file', 'month', 'number',...
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
ArrowFunction
() => { function setup(hasSubscriber: boolean) { const container = DI.createContainer(); const changeSet = <IChangeSet>container.get(IChangeSet); const observerLocator = <IObserverLocator>container.get(IObserverLocator); const el = <HTMLInputElement>createElement(`<input type="${...
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
ArrowFunction
() => { const { sut, changeSet, el, subscriber } = setup(hasSubscriber); const expectedValueBefore = nullValues.includes(valueBefore) ? sut.defaultValue : valueBefore; const expectedValueAfter = nullValues.includes(valueAfter) ? sut.defaultValue : valueAfter; ...
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
ArrowFunction
() => { function setup() { const container = DI.createContainer(); const observerLocator = <IObserverLocator>container.get(IObserverLocator); const el = <HTMLInputElement>createElement(`<input type="${inputType}"/>`); document.body.appendChild(el); const sut = <ValueAttr...
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
ArrowFunction
() => { const { sut, el, subscriber } = setup(); // TODO: only setting input.value to null sets it to empty string. Setting it to undefined actually coerces to 'undefined'. This should work consistently in both directions const expectedValueBefore = valueBefore === null ? ''...
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
TypeAliasDeclaration
type TwoWayBinding = Binding & { targetObserver: IBindingTargetObserver };
fkleuver/circleci-2.1
packages/runtime/test/unit/binding/element-observation/value-attribute-observer.spec.ts
TypeScript
ArrowFunction
response => { const blob = new Blob([response.blob()], { type: 'image/jpg'}); const reader = new FileReader(); reader.addEventListener('load', () => { this.imagenColeccion = reader.result.toString(); }, false); if (blob) { reader.readAsDataURL(blob); ...
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ArrowFunction
() => { this.imagenColeccion = reader.result.toString(); }
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ArrowFunction
res => { if (res[0] !== undefined) { this.cromosColeccion = res; this.OrdenarCromos(); this.GET_ImagenCromo(); console.log(res); } else { console.log('No hay cromos en esta coleccion'); this.cromosColeccion = undefined; } }
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ArrowFunction
response => { const blob = new Blob([response.blob()], { type: 'image/jpg'}); const reader = new FileReader(); reader.addEventListener('load', () => { this.imagenCromoArray[i] = reader.result.toString(); }, false); if (blob) { reader.readAsDataURL(blob); ...
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ArrowFunction
() => { this.imagenCromoArray[i] = reader.result.toString(); }
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ArrowFunction
(a, b) => a.Nombre.localeCompare(b.Nombre)
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ArrowFunction
response => { const blob = new Blob([response.blob()], { type: 'image/jpg'}); const reader = new FileReader(); reader.addEventListener('load', () => { this.imagenColeccion = reader.result.toString(); }, false); if (blob) { reader.readAsDataURL(blob); ...
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ClassDeclaration
@IonicPage() @Component({ selector: 'page-mis-cromos', templateUrl: 'mis-cromos.html', }) export class MisCromosPage { // PARAMETROS QUE RECOGEMOS DE LA PAGINA PREVIA coleccion:Coleccion; //PARAMETROS DE UNA COLECCION DE CROMOS imagenColeccion: string; cromosColeccion: Cromo[]; //PARAMETROS DE UN CR...
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
MethodDeclaration
//Se realizarán las siguiente tareas al inicializar la pantalla. ionViewDidLoad() { console.log('Bienvenido a la página de cromos de la coleccion'); this.CromosEImagenDeLaColeccion(this.coleccion); this.GET_Imagen(); }
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
MethodDeclaration
// Le pasamos la coleccion y buscamos la imagen que tiene y sus cromos CromosEImagenDeLaColeccion(coleccion: Coleccion) { console.log('entro a buscar cromos y foto'); console.log(coleccion.ImagenColeccion); // Si la coleccion tiene una foto (recordemos que la foto no es obligatoria) if (coleccion.Image...
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
MethodDeclaration
// Busca la imagen que tiene el nombre del cromo.Imagen y lo carga en imagenCromo GET_ImagenCromo() { // tslint:disable-next-line:prefer-for-of for (let i = 0; i < this.cromosColeccion.length; i++) { this.cromo = this.cromosColeccion[i]; if (this.cromo.Imagen !== undefined ) { // Busca en la base...
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
MethodDeclaration
// Ordena los cromos por nombre. Asi si tengo algun cromo repetido, salen juntos OrdenarCromos() { this.cromosColeccion.sort((a, b) => a.Nombre.localeCompare(b.Nombre)); }
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
MethodDeclaration
// Busca la imagen que tiene el nombre del coleccion.ImagenColeccion y lo carga en imagenColeccion GET_Imagen() { if (this.coleccion.ImagenColeccion !== undefined ) { // Busca en la base de datos la imágen con el nombre registrado en equipo.FotoEquipo y la recupera this.http.get('http://localhost:3000/...
alejandrogimeno/classpip-mobile
src/pages/mis-cromos/mis-cromos.ts
TypeScript
ArrowFunction
l => !l.isDisabled
rocf/Silly.WWW.Frontend
src/app/shared/layout/header/components/language-switch.component.ts
TypeScript
ArrowFunction
() => { abp.utils.setCookieValue( 'Abp.Localization.CultureName', languageName, new Date(new Date().getTime() + 5 * 365 * 86400000), // 5 year abp.appPath, ); window.location.reload(); }
rocf/Silly.WWW.Frontend
src/app/shared/layout/header/components/language-switch.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'language-switch', template: ` <div nz-dropdown class="alain-default__nav-item" nzPlacement="bottomRight" [nzDropdownMenu]="languageMenuTpl"> <i class="anticon {{currentLanguage.icon}}"></i> {{currentLanguage.displayName}} <i nz-icon nzType="down" style="font-...
rocf/Silly.WWW.Frontend
src/app/shared/layout/header/components/language-switch.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.languages = _.filter(this.localization.languages, l => !l.isDisabled); this.currentLanguage = this.localization.currentLanguage; }
rocf/Silly.WWW.Frontend
src/app/shared/layout/header/components/language-switch.component.ts
TypeScript
MethodDeclaration
changeLanguage(languageName: string): void { const input = new ChangeUserLanguageDto(); input.languageName = languageName; this._profileService.changeLanguage(input).subscribe(() => { abp.utils.setCookieValue( 'Abp.Localization.CultureName', language...
rocf/Silly.WWW.Frontend
src/app/shared/layout/header/components/language-switch.component.ts
TypeScript
ArrowFunction
(rack: LockerComponent) => { rack.resetComponent(); }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
rack => rack.selected
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { return {rack: rack, ix: ix}; }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: { rack: SimpleLockerComponent, ix: number }) => rack.rack.selected
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: { rack: SimpleLockerComponent, ix: number }) => rack.ix
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(total, rack) => total + rack.dimension.y
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
btl => { btl.positions = btl.positions.map( pos => { let newPos = pos; if (pos.inLocker(this.fridge.id)) { newPos = new Position(pos.lockerId, pos.x, pos.y, pos.rack + 1); } return newPos; } ); }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
pos => { let newPos = pos; if (pos.inLocker(this.fridge.id)) { newPos = new Position(pos.lockerId, pos.x, pos.y, pos.rack + 1); } return newPos; }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
btl => btl.positions.filter( pos => pos.inRack(this.fridge.id, 0) ).length > 0
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
pos => pos.inRack(this.fridge.id, 0)
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
btl => { btl.positions.forEach( pos => { let newPos = pos; if (pos.inLocker(this.fridge.id)) { newPos = new Position(pos.lockerId, pos.x, pos.y, pos.rack - 1); } return newPos; } ); }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
pos => { let newPos = pos; if (pos.inLocker(this.fridge.id)) { newPos = new Position(pos.lockerId, pos.x, pos.y, pos.rack - 1); } return newPos; }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
btl => btl.positions.filter( pos => pos.inRack(this.fridge.id, rackIndex) ).length > 0
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
pos => pos.inRack(this.fridge.id, rackIndex)
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateY(rack.locker, 1); this.shiftBottles(ix, 0, 1); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateY(rack.locker, -1); this.shiftBottles(ix, 0, -1); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateX(rack.locker, 1); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateX(rack.locker, -1); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateY(rack.locker, 1); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateY(rack.locker, -1); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateX(rack.locker, 1); this.shiftBottles(ix, 1, 0); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(rack: SimpleLockerComponent, ix: number) => { if (rack.selected) { this.updateX(rack.locker, -1); this.shiftBottles(ix, -1, 0); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
rack => result = result && rack.canRemoveFirstRow()
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
rack => result = result && rack.canRemoveLastRow()
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
rack => result = result && rack.canRemoveFirstColumn()
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
rack => result = result && rack.canRemoveLastColumn()
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(min, rack) => min = Math.min(min, rack.locker.dimension.x)
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
(max, oneRack) => Math.max(max, oneRack.dimension.x)
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
bottle => { bottle.positions = bottle.positions.map( pos => { if (pos.inRack(this.fridge.id, rack)) { return new Position(pos.lockerId, pos.x + shiftX, pos.y + shiftY, pos.rack); } else { return pos; } } ); }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
ArrowFunction
pos => { if (pos.inRack(this.fridge.id, rack)) { return new Position(pos.lockerId, pos.x + shiftX, pos.y + shiftY, pos.rack); } else { return pos; } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
MethodDeclaration
ngOnDestroy(): void { if (this.gesture) { this.gesture.destroy(); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
MethodDeclaration
public resetComponent() { if (this.rackComponents) { this.rackComponents.forEach( (rack: LockerComponent) => { rack.resetComponent(); } ); } }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript
MethodDeclaration
anyRackSelected() { return this.rackComponents.filter(rack => rack.selected).length > 0; }
loicsalou/ma-cave
src/components/locker/fridge-locker.component.ts
TypeScript