// TypeScript Version: 3.3 declare module 'ember-cli-page-object' { import { Component, Definition, FindOptions, TriggerOptions, GetterDescriptor, MethodDescriptor, DSL } from 'ember-cli-page-object/-private'; function create>(definition?: T): Component; function collection>(scope: string, definition?: T): Collection; // Attributes function attribute(attributeName: string, scope?: string, options?: FindOptions): GetterDescriptor; function isVisible(scope?: string, options?: FindOptions): GetterDescriptor; function isHidden(scope?: string, options?: FindOptions): GetterDescriptor; function isPresent(scope?: string, options?: FindOptions): GetterDescriptor; function text(scope?: string, options?: FindOptions & { normalize?: boolean }): GetterDescriptor; function value(scope?: string, options?: FindOptions): GetterDescriptor; function property(name: string): GetterDescriptor; function property(scope: string, name: string, options?: FindOptions): GetterDescriptor; function hasClass(className: string): GetterDescriptor; function hasClass(scope: string, className: string, options?: FindOptions): GetterDescriptor; function notHasClass(className: string): GetterDescriptor; function notHasClass(scope: string, className: string, options?: FindOptions): GetterDescriptor; function contains(scope?: string, options?: FindOptions): (text: string) => GetterDescriptor; function count(scope?: string, options?: FindOptions): () => GetterDescriptor; // Actions function clickable(scope?: string, userOptions?: FindOptions): MethodDescriptor<(this: T) => T>; function clickOnText(scope?: string, userOptions?: FindOptions): MethodDescriptor<(this: T, text: string) => T>; function fillable(scope?: string, userOptions?: FindOptions): MethodDescriptor<(this: T, clueOrContent: string, content?: string) => T>; function selectable(scope?: string, userOptions?: FindOptions): MethodDescriptor<(this: T, clueOrContent: string, content?: string) => T>; function triggerable(event: string, scope?: string, eventOptions?: TriggerOptions, options?: FindOptions): MethodDescriptor<(this: T, options?: {}) => T>; function focusable(scope?: string, options?: FindOptions): MethodDescriptor<(this: T) => T>; function blurrable(scope?: string, options?: FindOptions): MethodDescriptor<(this: T) => T>; function visitable(path: string): MethodDescriptor<(this: T, dynamicSegmentsAndQueryParams?: {}) => T>; interface Collection { (scope: string, definition?: T): Array>; [i: number]: Component; [Symbol.iterator](): Iterator>; filter(callback: (c: Component) => boolean): Array>; filterBy(propName: keyof T | keyof DSL, value?: any): Array>; findOne(callback: (c: Component) => boolean): Component; findOneBy(propName: keyof T | keyof DSL, value: any): Component; forEach(callback: (c: Component, i: number) => void): void; map(callback: (c: Component) => S): S[]; mapBy(propName: keyof T | keyof DSL): any[]; objectAt(i: number): Component; toArray(): Array>; } } declare module 'ember-cli-page-object/extend' { import 'jquery'; import { Component, FindOptions, FindOneOptions } from 'ember-cli-page-object/-private'; function findElement(pageObject: Component, scope?: string, options?: FindOptions): JQuery; function findElementWithAssert(pageObject: Component, scope?: string, options?: FindOptions): JQuery; function findOne(pageObject: Component, scope?: string, options?: FindOneOptions): Element; function findMany(pageObject: Component, scope?: string, options?: FindOptions): Element[]; } declare module 'ember-cli-page-object/macros' { import { GetterDescriptor } from 'ember-cli-page-object/-private'; function getter(body: (key: string) => T): GetterDescriptor; function alias(path: string, options?: { chainable: boolean }): any; } declare module 'ember-cli-page-object/-private' { import 'jquery'; import { clickable, clickOnText, fillable, focusable, blurrable } from 'ember-cli-page-object'; interface GetterDescriptor { isGetter: true; get: T; } interface MethodDescriptor(this: S, ...args: any[]) => S> { isMethod: true; (...args: Parameters): ReturnType; get(): T; } type Component = UnpackedDefinition & DSL & { [s: string]: unknown; }; type UnpackedDefinition = { [k in keyof T]: T[k] extends GetterDescriptor ? C : T[k] extends MethodDescriptor ? C : T[k] extends Function | Component ? T[k] : T[k] extends object ? Component : T[k] }; interface DSL { isHidden?: boolean; isPresent?: boolean; isVisible?: boolean; text?: string; value?: string; contains(textToSearch: string): boolean; blur(): Component; click(): Component; clickOn(text: string): Component; fillIn(clueOrContent: string, content?: string): Component; focus(): Component; then( onfulfilled?: (value: any) => any, onrejected?: (reason: any) => any ): Component; } interface Definition extends SelectorQueryOptions { scope?: string; [l: string]: unknown; } interface FindOptions extends FindOneOptions { multiple?: boolean; } interface FindOneOptions extends DomElementQueryOptions { contains?: string; scope?: string; last?: boolean; visible?: boolean; at?: number; } interface TriggerOptions extends FindOptions { eventProperties?: object; } interface DomElementQueryOptions extends SelectorQueryOptions { pageObjectKey?: string; } interface SelectorQueryOptions { resetScope?: boolean; testContainer?: string|HTMLElement|JQuery; } }