import 'package:freezed_annotation/freezed_annotation.dart'; part 'parse.freezed.dart'; part 'parse.g.dart'; @freezed class MWParseCategoryInfo with _$MWParseCategoryInfo { factory MWParseCategoryInfo({ required String category, @Default("") String sortkey, }) = _MWParseCategoryInfo; factory MWParseCategoryInfo.fromJson(Map json) => _$MWParseCategoryInfoFromJson(json); } @freezed class MWParseLangLinkInfo with _$MWParseLangLinkInfo { factory MWParseLangLinkInfo({ required String lang, required String title, @Default("") String url, @Default("") String langname, @Default("") autonym, }) = _MWParseLangLinkInfo; factory MWParseLangLinkInfo.fromJson(Map json) => _$MWParseLangLinkInfoFromJson(json); } @freezed class MWParsePageLinkInfo with _$MWParsePageLinkInfo { factory MWParsePageLinkInfo({ required int ns, required String title, @Default(false) bool exists, }) = _MWParsePageLinkInfo; factory MWParsePageLinkInfo.fromJson(Map json) => _$MWParsePageLinkInfoFromJson(json); } @freezed class MWParseSectionInfo with _$MWParseSectionInfo { factory MWParseSectionInfo({ required int toclevel, required String level, required String line, @Default("") String number, @Default("") String index, @Default("") String fromtitle, @Default(-1) int byteoffset, @Default("") String anchor, }) = _MWParseSectionInfo; factory MWParseSectionInfo.fromJson(Map json) => _$MWParseSectionInfoFromJson(json); } @freezed class MWParseInfo with _$MWParseInfo { factory MWParseInfo({ required String title, required int pageid, required int revid, required String text, String? displaytitle, @Default([]) List langlink, @Default([]) List categories, @Default([]) List links, @Default([]) List templates, @Default([]) List images, @Default([]) List externallinks, @Default([]) List sections, @Default(true) bool showtoc, @Default([]) List modules, @Default([]) List modulescripts, @Default([]) List modulestyles, @Default([]) List iwlinks, @Default({}) Map jsconfigvars, @Default({}) Map properties, }) = _MWParseInfo; factory MWParseInfo.fromJson(Map json) => _$MWParseInfoFromJson(json); } @freezed class MWParseResponse with _$MWParseResponse { factory MWParseResponse({required MWParseInfo parse}) = _MWParseResponse; factory MWParseResponse.fromJson(Map json) => _$MWParseResponseFromJson(json); }