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
37 lines (36 loc) • 1.35 kB
TypeScript
import { FreezedPluginConfig } from '../config';
import { FreezedFactoryBlockRepository, NodeType } from '../utils';
import { FreezedFactoryBlock } from './factory-block';
export declare class FreezedDeclarationBlock {
private _config;
private _freezedFactoryBlockRepository;
private _node;
/** document the class */
_comment: string;
/** a list of decorators to copy paste to the generator */
_decorators: string[];
/** the name of the class */
_name: string | undefined;
/** a list of default constructor and named Constructors used create a Freezed union/sealed class */
_factoryBlocks: FreezedFactoryBlock[];
/** 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, _freezedFactoryBlockRepository: FreezedFactoryBlockRepository, _node: NodeType);
init(): FreezedDeclarationBlock;
private setComment;
private getEnumComment;
private setDecorators;
private getFreezedDecorator;
private setName;
private setFactoryBlocks;
private setShape;
/**
* returns the string output of the block
*/
private setBlock;
/** returns the block */
toString(): string;
}