From 4e46f801f4c1c40f5a9631171eb16ad9ecd312c6 Mon Sep 17 00:00:00 2001 From: monoid Date: Wed, 6 Jan 2021 20:17:15 +0900 Subject: [PATCH] declare JSON Map --- src/model/contents.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/model/contents.ts b/src/model/contents.ts index 823489e..ceca139 100644 --- a/src/model/contents.ts +++ b/src/model/contents.ts @@ -1,6 +1,10 @@ import {TagAccessor} from './tag'; import {check_type} from './../util/type_check' +type JSONPrimitive = null|boolean|number|string; +interface JSONMap extends Record{} +interface JSONArray extends Array{}; +type JSONType = JSONMap|JSONPrimitive|JSONArray; export interface ContentContent{ title : string, @@ -8,7 +12,7 @@ export interface ContentContent{ basepath : string, filename : string, hash? : string, - additional : object, + additional : JSONMap, tags : string[],//eager loading }