graphql-codegen-flutter-freezed
Version:
A stand-alone package to generate Freezed models from GraphQL schema based on the flutter-freezed plugin for GraphQL Code Generator
46 lines (45 loc) • 1.51 kB
TypeScript
import { ApplyDecoratorOn, FreezedPluginConfig } from '../config';
import { FieldType, NodeType } from '../utils';
/**
* maps GraphQL scalar types to Dart's scalar types
*/
export declare const DART_SCALARS: Record<string, string>;
export declare class FreezedParameterBlock {
private _config;
private _appliesOn;
private _node;
private _field;
/** document the property */
_comment: string;
/** a list of decorators to copy paste to the generator */
_decorators: string[];
/** mark the property as required */
_required: boolean | undefined;
/** mark the property as required */
_type: string | undefined;
/** the name of the property */
_name: string | undefined;
/** the shape is the content of the block */
_shape: string | undefined;
/** the block is the final structure that is generated */
_block: string | undefined;
private _freezedConfigValue;
constructor(_config: FreezedPluginConfig, _appliesOn: ApplyDecoratorOn[], _node: NodeType, _field: FieldType);
init(): FreezedParameterBlock;
private setComment;
private setDecorators;
private setRequired;
private setType;
private setName;
/** compose the freezed constructor property */
private setShape;
/** composes the full block */
private setBlock;
private propertyType;
private isListType;
private isNonNullType;
private isNamedType;
private scalar;
/** returns the block */
toString(): string;
}