survey-pdf
Version:
Renders JSON-driven SurveyJS forms and their responses as PDF documents in the browser or Node.js: fillable interactive PDF forms (AcroForm) or static printouts.
66 lines (65 loc) • 3.13 kB
TypeScript
import { QuestionMatrixDropdownModelBase, Question, LocalizableString, QuestionSelectBase, MatrixDropdownColumn, ItemValue } from 'survey-core';
import { IPoint, DocController } from '../doc_controller';
import { FlatQuestion, IFlatQuestion } from './flat_question';
import { IPdfBrick } from '../pdf_render/pdf_brick';
import { ContainerBrick } from '../pdf_render/pdf_container';
import { IAlignedTextStyle, IContainerStyle, IQuestionMatrixDropdownStyle } from '../style/types';
import { FlatSelectBase } from './flat_selectbase';
interface IMatrixCellStyle {
container: IContainerStyle;
}
interface IMatrixFlatBaseOptions {
style: IMatrixCellStyle;
colSpan?: number;
}
declare abstract class MatrixCellBaseFlat<T extends IMatrixFlatBaseOptions = IMatrixFlatBaseOptions> {
protected controller: DocController;
protected options: T;
constructor(controller: DocController, options: T);
getColSpan(): number;
generateFlats(point: IPoint, width: number): Promise<ContainerBrick>;
abstract generateContentFlats(point: IPoint): Promise<Array<IPdfBrick>>;
}
interface IMatrixCellQuestionOptions<T extends Question = Question, S extends IFlatQuestion = IFlatQuestion> extends IMatrixFlatBaseOptions {
question: T;
flatQuestionFabric: (quesiton: T) => S;
}
declare class MatrixCellQuestionFlat<T extends IMatrixCellQuestionOptions = IMatrixCellQuestionOptions> extends MatrixCellBaseFlat<T> {
getColSpan(): number;
generateContentFlats(point: IPoint): Promise<Array<IPdfBrick>>;
}
interface IMatrixCellChoiceOptions extends IMatrixCellQuestionOptions<QuestionSelectBase, FlatSelectBase> {
item: ItemValue;
index: number;
}
export declare class MatrixCellChoiceFlat extends MatrixCellBaseFlat<IMatrixCellChoiceOptions> {
generateContentFlats(point: IPoint): Promise<Array<IPdfBrick>>;
}
interface IMatrixCellQuestionListStyle extends IMatrixCellStyle {
contentGap: number;
title: IAlignedTextStyle;
}
interface IMatrixCellQuestionListOptions extends IMatrixCellQuestionOptions {
style: IMatrixCellQuestionListStyle;
locTitle: LocalizableString;
}
export declare class MatrixCellQuestionListFlat extends MatrixCellQuestionFlat<IMatrixCellQuestionListOptions> {
generateContentFlats(point: IPoint): Promise<Array<IPdfBrick>>;
}
export declare class FlatMatrixMultiple<T extends QuestionMatrixDropdownModelBase = QuestionMatrixDropdownModelBase, S extends IQuestionMatrixDropdownStyle = IQuestionMatrixDropdownStyle> extends FlatQuestion<T, S> {
protected getMatrixRows(): import("survey-core").MatrixDropdownRowModelBase[];
protected isMatrixColumnVisible(column: MatrixDropdownColumn): boolean;
private getMatrixColumnDescriptors;
private getColumnsAvalableWidth;
private getPredefinedTransposedColumnWidths;
private getPredefinedColumnWidts;
private calculateColumnWidth;
private getMultipleColumnChoices;
private buildTableCore;
private buildTable;
private buildTransposedTable;
private buildListTable;
private calculateIsList;
generateFlatsContent(point: IPoint): Promise<IPdfBrick[]>;
}
export {};