dictionary - From JSON to Typescript interface -
i'm going crazy.
i have json:
{ 'name': 'help me', 'filters': { 'filter1': { 'filter_id': 'wow', 'filter_query': 'maw', }, 'filter2': { 'filter_id': 'wow', 'filter_query': 'maw', } } }
and i'm trying in way:
export interface myobject { name: string; filters: filters; } export interface filters { [key: string]: queryfilter; } export interface queryfilter { filter_id: string; filter_query: string; friendly_filter_query: string; }
or in way:
export interface myobject { name: string; filters: map<string, queryfilter[]>;}
but in first case got error message:
property 'filters' missing in type '{ 'name': string; ...'.
and in second case got this:
property 'clear' missing in type '{ 'filter1': { 'filter_id': string; 'filter_query': string; }...'.
i can't figure out.
Comments
Post a Comment