UNPKG

@graphql-codegen/flutter-freezed

Version:

GraphQL Code Generator plugin to generate Freezed models from your GraphQL schema

46 lines (45 loc) 1.53 kB
import { ApplyDecoratorOn, FlutterFreezedPluginConfig } from '../config.cjs'; import { FieldType, NodeType } from '../utils.cjs'; /** * 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: FlutterFreezedPluginConfig, _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; }