Add type declarations + test min-document