type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(date) => { const model = Object.assign(new OfficeBookingModel(), { date, name: officeId }); return [resultKey(model), model]; }
AtifKhokhar/office-booker
server/db/officeBookings.ts
TypeScript
ClassDeclaration
@table('office-bookings') export class OfficeBookingModel { /** This is still called name, but now contains the officeId since version 3 */ @hashKey() name!: string; @rangeKey() date!: string; @attribute() bookingCount!: number; @attribute() parkingCount!: number; @attribute() ttl!: number; }
AtifKhokhar/office-booker
server/db/officeBookings.ts
TypeScript
InterfaceDeclaration
export interface OfficeBooking { officeId: string; date: string; bookingCount: number; parkingCount: number; }
AtifKhokhar/office-booker
server/db/officeBookings.ts
TypeScript
ArrowFunction
(c) => this.schema.displayName(c.name)
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => { const newPercent = percentDialog.getFieldValueAsNumber("newPercent"); if (newPercent != null) { const rr = this.remoteTableObject.createHeavyHittersRequest( this.columnsShown, newPercent, this.rowCount, HeavyHit...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => this.showTable(isApprox, true)
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => this.showTable(isApprox, false)
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => this.exactCounts()
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => this.changeThreshold()
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
(c) => { header.push(this.schema.displayName(c.name)); tips.push("Column name"); }
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
(e) => this.clickThenShowContextMenu(tRow, e)
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => this.showSelected(true)
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => this.showSelected(false)
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
(e) => e.preventDefault()
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ArrowFunction
() => { const newPercent = percentDialog.getFieldValueAsNumber("newPercent"); if (newPercent != null) this.runWithThreshold(newPercent); }
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ClassDeclaration
/** * This method handles the outcome of the sketch for finding Heavy Hitters. */ export class HeavyHittersReceiver extends OnCompleteReceiver<TopList> { public constructor(page: FullPage, protected readonly remoteTableObject: TableTargetAPI, operation: ICancellable<T...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ClassDeclaration
/** * This class handles the reply of the "checkHeavy" method when the goal is to to compute and display the Exact counts. */ export class HeavyHittersReceiver2 extends OnCompleteReceiver<TopList> { public constructor(public hhv: HeavyHittersView, public operation: ICancellable<TopList>) { ...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ClassDeclaration
/** * This class handles the reply of the "checkHeavy" method when the goal is to filter the table, starting from an * approximate HeavyHitters sketch. It uses the TopList returned by Check Heavy to filter the table using the * "filterHeavy" method. * The code is fairly similar to that in showTable(). */ export cl...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public run(data: TopList): void { if (data.top.rows.length === 0) this.showEmptyDialog(); else { const names = this.columnsShown.map((c) => this.schema.displayName(c.name)).join(", "); let newPage = this.page; if (!this.reusePage) newPage = this.page....
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private showEmptyDialog(): void { const percentDialog = new Dialog("No Frequent Elements", ""); percentDialog.addText("No elements found with frequency above " + this.percent.toString() + "%."); if (this.percent > HeavyHittersView.min) { percentDialog.addText("Lower the threshold? C...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public serialize(): IViewSerialization { const result: HeavyHittersSerialization = { ...super.serialize(), order: this.originalTableOrder, percent: this.percent, remoteTableId: this.remoteTableObject.remoteObjectId, isApprox: this.isApprox, ...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public static reconstruct(ser: HeavyHittersSerialization, page: FullPage): IDataView { const schema: SchemaClass = new SchemaClass([]).deserialize(ser.schema); const percent: number = ser.percent; const order = new RecordOrder(ser.order.sortOrientationList); const remoteTableId: string ...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public refresh(): void { const rr = this.remoteTableObject.createHeavyHittersRequest( this.columnsShown, this.percent, this.rowCount, HeavyHittersView.switchToMG); rr.invoke(new HeavyHittersReceiver( this.getPage(), this, rr, this.rowCount, this.schema, this.original...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public resize(): void {}
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
/** * Method the creates the filtered table. If isApprox is true, then there are two steps: we first compute the exact * heavy hitters and then use that list to filter the table. If isApprox is false, we compute the table right away. */ public showTable(isApprox: boolean, includeSet: boolean): void { ...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public showSelected(includeSet: boolean): void { if (this.table.getSelectedRows().size === 0) return; const title: string = includeSet ? "Selected frequent elements" : "All other elements"; const newPage = this.dataset.newPage(title, this.page); const rr = this.remoteTableOb...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private getSelectedRows(): number[] { const sRows: number[] = cloneSet(this.table.getSelectedRows()); if (this.restPos === -1) return sRows; else { const tRows: Set<number> = new Set<number>(); for (const j of sRows) { if (j < this.restPos) ...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public exactCounts(): void { const rr = this.remoteTableObject.createCheckHeavyRequest( new RemoteObject(this.heavyHittersId), this.columnsShown); rr.invoke(new HeavyHittersReceiver2(this, rr)); }
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public updateView(nextKList: NextKList, elapsedMs: number): void { this.setRest(nextKList); if (nextKList.rows != null) { let k = 0; let position = 0; for (let i = 0; i < nextKList.rows.length; i++) { k++; if (i === this.restPos) { ...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private static showLongDialog(total: number): void { const longListDialog = new Dialog("Too Many Frequent Elements", ""); longListDialog.addText("Showing the top " + HeavyHittersView.maxDisplay.toString() + " elements out of " + total); longListDialog.addText("Use the 'View as Table...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private clickThenShowContextMenu(tRow: HTMLTableRowElement, e: MouseEvent): void { this.table.clickRow(tRow, e); if (e.button === 1) return; // If it was in fact a CTRL+ leftClick on a Mac, don't show the context menu. const selectedCount = this.table.selectedRows.size(); this.contextMe...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
/** * Method to compute the parameters restCount (count for everything else) and restPos (its rank in the List). */ private setRest(tdv: NextKList): void { if (tdv.rows == null) { this.restCount = tdv.rowsScanned; this.restPos = 0; } else { let runCount = td...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private showRest(k: number, position: number, restCount: number, total: number, table: TabularDisplay): void { const row: Element[] = []; row.push(makeSpan(k.toString(), false)); for (let j = 0; j < this.columnsShown.length; j++) { // tslint:disable-line const m = makeSpan("everythi...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private valueToHtml(n: number): HTMLElement { const span = document.createElement("span"); let str = significantDigitsHtml(n); if (this.isApprox) str = str.prependString(SpecialChars.approx); str.setInnerHtml(span); return span; }
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private runWithThreshold(newPercent: number): void { const rr = this.remoteTableObject.createHeavyHittersRequest( this.columnsShown, newPercent, this.rowCount, HeavyHittersView.switchToMG); rr.invoke(new HeavyHittersReceiver( this.getPage(), this.remoteTableObject, r...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
private changeThreshold(): void { const percentDialog = new Dialog("Change the frequency threshold", "Changes the frequency threshold above which elements are considered frequent"); percentDialog.addText("Enter a percentage between " + HeavyHittersView.minString + " and 100%"); perc...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
protected getCombineRenderer(title: string): (page: FullPage, operation: ICancellable<RemoteObjectId>) => BaseRenderer { // Not used return null; }
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public combine(how: CombineOperators): void { // not used }
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public run(newData: TopList): void { const newHhv = new HeavyHittersView( newData.heavyHittersId, this.page, this.hhv.remoteTableObject, this.hhv.rowCount, this.hhv.schema, this.hhv.originalTableOrder, false, this.hhv.percent, this.hhv.columnsShown); this.page.setDat...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
MethodDeclaration
public run(exactList: TopList): void { const title = (this.includeSet) ? "Frequent Elements" : "Infrequent Elements"; const newPage = this.hhv.dataset.newPage(title, this.hhv.page); const rr = this.hhv.remoteTableObject.createFilterHeavyRequest( exactList.heavyHittersId, this.hhv.co...
uwieder/Hillview
web/src/main/webapp/dataViews/heavyHittersView.ts
TypeScript
ClassDeclaration
class Graph extends Component<IProps, {}> { table: Table | undefined; render() { return React.createElement('perspective-viewer'); } componentDidMount() { // Get element from the DOM. const elem = document.getElementsByTagName('perspective-viewer')[0] as unknown as PerspectiveViewerEleme...
MThakkar121/JPMorgan_Virtual_Training
JPmorgan_task_3/src/Graph.tsx
TypeScript
InterfaceDeclaration
interface IProps { data: ServerRespond[], }
MThakkar121/JPMorgan_Virtual_Training
JPmorgan_task_3/src/Graph.tsx
TypeScript
InterfaceDeclaration
interface PerspectiveViewerElement extends HTMLElement { load: (table: Table) => void, }
MThakkar121/JPMorgan_Virtual_Training
JPmorgan_task_3/src/Graph.tsx
TypeScript
MethodDeclaration
render() { return React.createElement('perspective-viewer'); }
MThakkar121/JPMorgan_Virtual_Training
JPmorgan_task_3/src/Graph.tsx
TypeScript
MethodDeclaration
componentDidMount() { // Get element from the DOM. const elem = document.getElementsByTagName('perspective-viewer')[0] as unknown as PerspectiveViewerElement; const schema = { price_abc: 'float', price_def: 'float', ratio: 'float', timestamp: 'date', upper_bound: 'fl...
MThakkar121/JPMorgan_Virtual_Training
JPmorgan_task_3/src/Graph.tsx
TypeScript
MethodDeclaration
componentDidUpdate() { if (this.table) { this.table.update([ DataManipulator.generateRow(this.props.data), ]); } }
MThakkar121/JPMorgan_Virtual_Training
JPmorgan_task_3/src/Graph.tsx
TypeScript
TypeAliasDeclaration
export type StorePhotoSizes = StoredPayload<Slice['photoSizes']>
codegeous/treact
packages/treact/src/app/redux/modules/photos/sizes.ts
TypeScript
ArrowFunction
() => { it("works if true is truthy", () => { expect(true).toBeTruthy() }) it("DummyClass is instantiable", () => { // expect(new DummyClass()).toBeInstanceOf(DummyClass) }) }
tobyhui/getpath
test/getpath.test.ts
TypeScript
ArrowFunction
() => { expect(true).toBeTruthy() }
tobyhui/getpath
test/getpath.test.ts
TypeScript
ArrowFunction
() => { // expect(new DummyClass()).toBeInstanceOf(DummyClass) }
tobyhui/getpath
test/getpath.test.ts
TypeScript
ArrowFunction
item => { return ( <li> <i class={`fa fa-${item.icon}`}
Jingyi21/PHP-Captcha
src/components/AboutTeamUnit.tsx
TypeScript
ClassDeclaration
@Component({}) export default class AboutTeamUnit extends Vue { @Prop() private data!: TeamUnit; private render() { return ( <article class="about__team--unit"> <div class="about__team--unit--header"> <img class="about__team--unit--avatar" src={this.data.avatar} /> <h3 clas...
Jingyi21/PHP-Captcha
src/components/AboutTeamUnit.tsx
TypeScript
InterfaceDeclaration
interface TeamUnit { name: string; avatar: object | string; position: string; contact: TeamUnitContact[]; }
Jingyi21/PHP-Captcha
src/components/AboutTeamUnit.tsx
TypeScript
InterfaceDeclaration
interface TeamUnitContact { icon: string; }
Jingyi21/PHP-Captcha
src/components/AboutTeamUnit.tsx
TypeScript
MethodDeclaration
private render() { return ( <article class="about__team--unit"> <div class="about__team--unit--header"> <img class="about__team--unit--avatar" src={this.data.avatar} /> <h3 class="about__team--unit--name">{this.data.name}</h3> <p class="about__team--unit--position">{this...
Jingyi21/PHP-Captcha
src/components/AboutTeamUnit.tsx
TypeScript
ArrowFunction
(seconds: number) => new Promise((resolve) => setTimeout(resolve, seconds * 1000))
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ArrowFunction
(resolve) => setTimeout(resolve, seconds * 1000)
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ArrowFunction
() => { it('add item in queue', () => { const queue = new PromiseQueue() queue.add(async () => { await sleep(3) }) expect(queue.promises.length).toEqual(1) }) it('check promise is running', () => { const queue = new PromiseQueue() queue.add(async () => { await sleep(3) }...
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ArrowFunction
() => { const queue = new PromiseQueue() queue.add(async () => { await sleep(3) }) expect(queue.promises.length).toEqual(1) }
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ArrowFunction
async () => { await sleep(3) }
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ArrowFunction
() => { const queue = new PromiseQueue() queue.add(async () => { await sleep(3) }) queue.add(async () => { await sleep(3) }) const { isRunning } = queue.promises[0] expect(isRunning).toBe(true) }
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ArrowFunction
() => { const queue = new PromiseQueue() queue.add(async () => { await sleep(3) }) queue.add(async () => { await sleep(3) }) const { isWaiting } = queue.promises[0] expect(isWaiting).toBe(false) }
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ArrowFunction
() => { const queue = new PromiseQueue() queue.add(async () => { await sleep(3) }) queue.add(async () => { await sleep(3) }) const {isWaiting} = queue.promises[1] expect(isWaiting).toBe(true) }
friendlyss/promises-queue
test/blah.test.ts
TypeScript
ClassDeclaration
export class Service extends DatabaseService<Model> { public constructor(postgresDatabase?: PostgresDatabase) { super(Model, postgresDatabase); } }
OneUptime/app
CommonServer/Services/ScheduledEventNoteService.ts
TypeScript
ClassDeclaration
export class User { public readonly id: string; public name: string; public email: string; public passwor: string; constructor(props: Omit<User, id>, id? : string){ Object.assign(props, this); if(!id) { this.id = uuid(); } }; }
euRamiro/solid_api
src/entities/User.ts
TypeScript
FunctionDeclaration
// get url parameters export function getParameters(): ParsedUrlQuery { const args = window.location.search.substr(1); return queryparse(args); }
not-a-seagull/LeadershipTrakcer
frontend/parameter.ts
TypeScript
FunctionDeclaration
export function getParameter(parameterName: string): Nullable<string> { const parameters = getParameters(); if (parameters.hasOwnProperty(parameterName)) { const parameter = parameters[parameterName]; if (parameter instanceof Array) throw new Error("Unhandled edge case: parameter is array"); return par...
not-a-seagull/LeadershipTrakcer
frontend/parameter.ts
TypeScript
TypeAliasDeclaration
export type ListSchemaConfig = Record<string, ListConfig<BaseGeneratedListTypes, any>>;
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type ListConfig< TGeneratedListTypes extends BaseGeneratedListTypes, Fields extends BaseFields<TGeneratedListTypes> > = { /* A note on defaults: several options default based on the listKey, including label, path, singular, plural, itemQueryName and listQueryName. All these options default ind...
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type ListAdminUIConfig< TGeneratedListTypes extends BaseGeneratedListTypes, Fields extends BaseFields<TGeneratedListTypes> > = { /** * The field to use as a label in the Admin UI. If you want to base the label off more than a single field, use a virtual field and reference that field here. * @defaul...
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type BaseFields<TGeneratedListTypes extends BaseGeneratedListTypes> = { [key: string]: FieldType<TGeneratedListTypes>; };
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type FieldType<TGeneratedListTypes extends BaseGeneratedListTypes> = { /** * The real keystone type for the field */ type: any; /** * The config for the field */ config: FieldConfig<TGeneratedListTypes>; /** * The resolved path to the views for the field type */ views: string; ge...
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type FieldConfig<TGeneratedListTypes extends BaseGeneratedListTypes> = { access?: FieldAccessControl<TGeneratedListTypes>; hooks?: ListHooks<TGeneratedListTypes>; // really? ListHooks? label?: string; ui?: { views?: string; description?: string; createView?: { fieldMode?: MaybeSessionF...
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type MaybeSessionFunction<T extends string | boolean> = | T | ((args: { session: any }) => MaybePromise<T>);
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type MaybeItemFunction<T> = | T | ((args: { session: any; item: { id: string | number; [path: string]: any }; }) => MaybePromise<T>);
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type ListGraphQLConfig = { // was previously top-level cacheHint // cacheHint?: CacheHint; /** * The description added to the GraphQL schema * @default listConfig.description */ description?: string; // was previously top-level itemQueryName itemQueryName?: string; // the name of the graphq...
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
TypeAliasDeclaration
export type ListDBConfig = { /** * The name of the field to use for `search` filter operations. * @default "name"" */ searchField?: string; };
OpenSaasAU/keystone
packages-next/types/src/config/lists.ts
TypeScript
ArrowFunction
async (region: string, options?: any) => getRegionInfo(region, { ...options, signingService: "mgh", regionHash, partitionHash, })
christophgysin/aws-sdk-js-v3
deno/client-migration-hub/endpoints.ts
TypeScript
FunctionDeclaration
function HowToInfo({}: Props): ReactElement { return ( <div className={styles.wrapper}> <div className="flex p-8 flex-col text-justify"> <h3 className="text-2xl mb-4">It's damn easy!</h3> <h5 className="text-md">Hiring a car in the UK is easy with us:</h5> <ul className="my-4"> ...
pal-mangesh/Easy-work-from-home-front
src/hoc/HowToInfo/index.tsx
TypeScript
ArrowFunction
(props) => { const { isOpen, onOpen, onClose } = useDisclosure(); const handleToggle = () => (isOpen ? onClose() : onOpen()); const { data, loading } = useMeQuery({ notifyOnNetworkStatusChange: true }); return ( <Flex as="header" align="center" justify="space-between" wra...
jvogit/todo-react
client/src/components/Header.tsx
TypeScript
ArrowFunction
() => (isOpen ? onClose() : onOpen())
jvogit/todo-react
client/src/components/Header.tsx
TypeScript
MethodDeclaration
isOpen ? <CloseIcon
jvogit/todo-react
client/src/components/Header.tsx
TypeScript
ArrowFunction
async ( params: Readonly<Record<string, string | number>> ): Promise<{ jobs: Job[] }> => { const jobsResult = await this.fetch( "post", `${this.listUrl(params)}/list`, { ...params } ); return { jobs: jobsResult.jobs, }; }
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
ArrowFunction
async ( params: Readonly<Record<string, string | number>> ): Promise<Job> => { const jobResult: { job: JobItem; attempts: { attempt: Attempt; logs: Logs }[]; } = await this.fetch("post", `${this.url(params)}/get`, params); const attemptsValue = jobResult.attem...
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
ArrowFunction
(attemptItem) => attemptItem.attempt
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
ArrowFunction
(attemptItem) => [ attemptItem.attempt.id, attemptItem.logs, ]
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
ArrowFunction
async ( params: Readonly<Record<string, string | number>> ): Promise<Job> => { const jobResult: { job: JobItem; attempts: { attempt: Attempt; logs: Logs }[]; } = await this.fetch("post", `${this.url(params)}/cancel`, params); const attemptsValue = jobResult.at...
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
ClassDeclaration
export default class JobResource extends BaseResource implements Job { readonly job: JobItem = { id: 0, configType: "", configId: "", createdAt: 0, startedAt: 0, updatedAt: 0, status: null, }; readonly attempts: Attempt[] = []; readonly logsByAttempt: { [key: string]: Logs } = {}; ...
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
InterfaceDeclaration
export interface JobItem { id: number | string; configType: string; configId: string; createdAt: number; startedAt: number; updatedAt: number; status: Status | null; }
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
InterfaceDeclaration
export interface Logs { logLines: string[]; }
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
InterfaceDeclaration
export interface Attempt { id: number; status: string; createdAt: number; updatedAt: number; endedAt: number; bytesSynced: number; recordsSynced: number; }
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
InterfaceDeclaration
export interface Job { job: JobItem; logsByAttempt: { [key: string]: Logs }; attempts: Attempt[]; }
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
MethodDeclaration
pk(): string { return this.job?.id?.toString(); }
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
MethodDeclaration
static getFetchOptions(): FetchOptions { return { pollFrequency: 2500, // every 2,5 seconds }; }
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
MethodDeclaration
static listShape<T extends typeof Resource>( this: T ): ReadShape<SchemaDetail<{ jobs: Job[] }>> { return { ...super.listShape(), fetch: async ( params: Readonly<Record<string, string | number>> ): Promise<{ jobs: Job[] }> => { const jobsResult = await this.fetch( ...
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
MethodDeclaration
static detailShape<T extends typeof Resource>( this: T ): ReadShape<SchemaDetail<Job>> { return { ...super.detailShape(), fetch: async ( params: Readonly<Record<string, string | number>> ): Promise<Job> => { const jobResult: { job: JobItem; attempts: { at...
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
MethodDeclaration
static cancelShape<T extends typeof Resource>( this: T ): MutateShape<SchemaDetail<Job>> { return { ...super.partialUpdateShape(), fetch: async ( params: Readonly<Record<string, string | number>> ): Promise<Job> => { const jobResult: { job: JobItem; attem...
69mb/airbyte
airbyte-webapp/src/core/resources/Job.ts
TypeScript
FunctionDeclaration
export async function getPicture(Helper: GlobalHelper): Promise<SynoPicture | null>{ try{ if (!CurrentPicture){ await getPicturePrefetch(Helper); } const CurrentPictureResult = CurrentPicture; getPicturePrefetch(Helper); return CurrentPictureResult; } catch (err){ Helper.ReportingError(err, "Unknown E...
ioBrokerTranslator/ioBroker.slideshow
src/modules/slideSynology.ts
TypeScript
FunctionDeclaration
export async function getPicturePrefetch(Helper: GlobalHelper): Promise<void> { // Select Image from list try{ if (CurrentImages.length !== 0){ if (!CurrentImage){ CurrentImage = CurrentImages[0]; } else { if (CurrentImages.indexOf(CurrentImage) === CurrentImages.length - 1){ CurrentImage = Curr...
ioBrokerTranslator/ioBroker.slideshow
src/modules/slideSynology.ts
TypeScript
FunctionDeclaration
export async function updatePictureList(Helper: GlobalHelper): Promise<SynoPictureListUpdateResult> { await loginSyno(Helper); const CurrentImageList: SynoPicture[] = [ { path: "0", url: "", info1: "", info2: "", info3: "", date: null, x: 0, y: 0} ]; if (synoConnectionState === true){ // Retrieve complete list of...
ioBrokerTranslator/ioBroker.slideshow
src/modules/slideSynology.ts
TypeScript