Skip to content

Commit

Permalink
Typescript fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grassick committed Apr 5, 2022
1 parent f4c62fd commit a06715e
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 184 deletions.
2 changes: 1 addition & 1 deletion lib/ItemListComponent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export default class ItemListComponent extends React.Component<ItemListComponent
constructor(props: any);
validate(scrollToFirstInvalid: any): Promise<boolean>;
handleNext(index: any): any;
renderItem: (item: any, index: any) => any;
renderItem: (item: any, index: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
render(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
}
2 changes: 1 addition & 1 deletion lib/formDesign.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface Section {
/** All item types including sections and roster matrix columns */
export declare type Item = BasicItem | MatrixColumn | Section;
/** Item such as a question or instruction that make up the basic building block of a form. Does not include roster matrix column or section */
export declare type BasicItem = Question | Instructions | RosterGroup | RosterMatrix | Group;
export declare type BasicItem = Question | Instructions | RosterGroup | RosterMatrix | Group | Timer;
/** Question of various types which records an answer in the response */
export interface QuestionBase {
_id: string;
Expand Down
7 changes: 7 additions & 0 deletions lib/formRenderUtils.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ReactElement } from "react";
import { Item } from "./formDesign";
import { Schema } from "mwater-expressions";
import { default as ResponseRow } from "./ResponseRow";
import { ResponseData } from "./response";
/** Render an item, given its data, visibility function, etc. */
export declare function renderItem(item: Item, data: any, responseRow: ResponseRow, schema: Schema, onDataChange: (data: ResponseData) => void, isVisible: () => boolean, onNext: () => any, ref?: (c: any) => void): ReactElement;
2 changes: 0 additions & 2 deletions lib/formRenderUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderItem = void 0;
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
const lodash_1 = __importDefault(require("lodash"));
const formUtils = __importStar(require("./formUtils"));
const react_1 = __importDefault(require("react"));
Expand Down
325 changes: 149 additions & 176 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/formDesign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface Section {
export type Item = BasicItem | MatrixColumn | Section

/** Item such as a question or instruction that make up the basic building block of a form. Does not include roster matrix column or section */
export type BasicItem = Question | Instructions | RosterGroup | RosterMatrix | Group
export type BasicItem = Question | Instructions | RosterGroup | RosterMatrix | Group | Timer

/** Question of various types which records an answer in the response */
export interface QuestionBase {
Expand Down
8 changes: 5 additions & 3 deletions src/formRenderUtils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
import _ from "lodash"
import * as formUtils from "./formUtils"
import React from "react"
import React, { ReactElement } from "react"
const R = React.createElement

import QuestionComponent from "./QuestionComponent"
Expand All @@ -11,6 +9,10 @@ import TimerComponent from "./TimerComponent"
import GroupComponent from "./GroupComponent"
import RosterGroupComponent from "./RosterGroupComponent"
import RosterMatrixComponent from "./RosterMatrixComponent"
import { Item } from "./formDesign"
import { Schema } from "mwater-expressions"
import { default as ResponseRow } from "./ResponseRow"
import { ResponseData } from "./response"

/** Render an item, given its data, visibility function, etc. */
export function renderItem(
Expand Down

0 comments on commit a06715e

Please sign in to comment.