Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prepare for TS defs generation [skip ci] #121

Merged
merged 2 commits into from
May 27, 2020
Merged

Conversation

web-padawan
Copy link
Member

Fixes #116

Generated TS definitions look like this:

vaadin-grid-pro-edit-column.d.ts

import {FlattenedNodesObserver} from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';

import {get, set} from '@polymer/polymer/lib/utils/path.js';

import {GridColumnElement} from '@vaadin/vaadin-grid/src/vaadin-grid-column.js';

declare class GridProEditColumnElement extends GridColumnElement {
  path: string|null|undefined;
  editModeRenderer: GridBodyRenderer|undefined;
  editorOptions: string[];
  editorType: GridProEditorType;
  editorValuePath: string;
  ready(): void;
  _prepareBodyTemplate(): HTMLTemplateElement|null;
  _selectFirstTemplate(header?: boolean, footer?: boolean, editor?: boolean): HTMLTemplateElement|null;
  _findTemplate(header: boolean, footer: boolean, editor?: boolean): HTMLTemplateElement|null;
  _getEditorTagName(cell: HTMLElement): string;
  _getEditorComponent(cell: HTMLElement): HTMLElement|null;
  _getEditorValue(editor: HTMLElement): string|undefined;
  _startCellEdit(cell: HTMLElement, model: GridRowData): void;
  _stopCellEdit(cell: HTMLElement, model: GridRowData): void;
}

declare global {
  interface HTMLElementTagNameMap {
    "vaadin-grid-pro-edit-column": GridProEditColumnElement;
  }
}

export {GridProEditColumnElement};

import {GridBodyRenderer} from '@vaadin/vaadin-grid/@types/interfaces';

import {GridProEditorType} from '../@types/interfaces';

import {GridRowData} from '@vaadin/vaadin-grid/@types/interfaces';

vaadin-grid-pro-inline-editing-mixin.d.ts

import {microTask} from '@polymer/polymer/lib/utils/async.js';

import {Debouncer} from '@polymer/polymer/lib/utils/debounce.js';

import {PolymerElement} from '@polymer/polymer/polymer-element.js';

export {InlineEditingMixin};

declare function InlineEditingMixin<T extends new (...args: any[]) => {}>(base: T): T & InlineEditingMixinConstructor;

interface InlineEditingMixinConstructor {
  new(...args: any[]): InlineEditingMixin;
}

export {InlineEditingMixinConstructor};

interface InlineEditingMixin {
  enterNextRow: boolean|null|undefined;
  singleCellEdit: boolean|null|undefined;
  ready(): void;
  _checkImports(): void;
  _stopEdit(shouldCancel?: boolean, shouldRestoreFocus?: boolean): void;
  _switchEditCell(e: KeyboardEvent): void;
  _updateItem(row: HTMLElement, item: GridItem|null): void;
}

import {GridItem} from '@vaadin/vaadin-grid/@types/interfaces';

vaadin-grid-pro.d.ts

import {GridElement} from '@vaadin/vaadin-grid/src/vaadin-grid.js';

import {InlineEditingMixin} from './vaadin-grid-pro-inline-editing-mixin.js';

declare class GridProElement extends
  InlineEditingMixin(
  GridElement) {
  static _finalizeClass(): void;
}

declare global {
  interface HTMLElementTagNameMap {
    "vaadin-grid-pro": GridProElement;
  }
}

export {GridProElement};

@web-padawan web-padawan requested a review from Haprog May 27, 2020 10:00
src/vaadin-grid-pro-edit-column.html Outdated Show resolved Hide resolved
src/vaadin-grid-pro-edit-column.html Outdated Show resolved Hide resolved
@web-padawan web-padawan requested a review from Haprog May 27, 2020 11:00
@web-padawan web-padawan merged commit 44fde69 into master May 27, 2020
@web-padawan web-padawan deleted the gen-ts-defs branch May 27, 2020 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate TypeScript definitions for P3
2 participants