Skip to content
Snippets Groups Projects
Commit 7cdf0f60 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Put types in folder types

parent 58191300
No related branches found
No related tags found
1 merge request!224Resolve "Rework references"
Pipeline #123582 waiting for manual action with stages
in 7 minutes and 9 seconds
import { useArticlesStore, type CslJson } from '../stores/articles' import { useArticlesStore } from '../stores/articles'
import { ref, computed, watchEffect, toValue } from "vue" import { ref, computed, watchEffect, toValue } from "vue"
// import { useFetch } from '#app'; // import { useFetch } from '#app';
// import { useFetch } from "nuxt" // import { useFetch } from "nuxt"
import { type MaybeRef, useFetch } from '#imports' import { type MaybeRef, useFetch } from '#imports'
import article from "@/public/articles.json" import type { CslJson, CrossrefArticle, SrcArticle } from '@/types/articles';
export interface CrossrefArticle {
DOI: string;
issue: number;
type: string;
title: string[];
author: Array<{ family: string; given: string }>;
// "container-title-short": string;
"short-container-title": string;
"container-title": string;
abstract?: string;
published: {
"date-parts": string[];
};
issued: {
"date-parts": string[];
};
}
export interface WikiArticle {
DOI: string
title: string
subtitle: string
author: Array<{ family: string; given: string }>
containerTitle: string
abstract: string
year: string
href: string
target: string
prependIcon: string
}
export interface RawArticle {
message: CrossrefArticle
}
type SrcArticle = CrossrefArticle | CslJson
export function useFetchArticle(doi: MaybeRef<string> = ref("")) { export function useFetchArticle(doi: MaybeRef<string> = ref("")) {
// const article = ref<Article>() // const article = ref<Article>()
......
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { ref } from 'vue' import { ref } from 'vue'
// import jsonArticles from '@/assets/articles.json' // import jsonArticles from '@/assets/articles.json'
import type { CslJson } from "@/types/articles"
export interface CslJson {
// id: string
type: string
title: string
"container-title": string
// page: string,
// volume: string,
abstract: string
// URL: string
DOI: string
// journalAbbreviation: string
// language: string
author: Array<{ family: string, given: string }>
issued: {
"date-parts": Array<string>
},
}
export const useArticlesStore = defineStore('articles', () => { export const useArticlesStore = defineStore('articles', () => {
const articleMap = new Map([]) const articleMap = new Map([])
......
export interface WikiArticle {
DOI: string
title: string
subtitle: string
author: Array<{ family: string; given: string }>
containerTitle: string
abstract: string
year: string
href: string
target: string
prependIcon: string
}
export interface CslJson {
// id: string
type: string
title: string
"container-title": string
// page: string,
// volume: string,
abstract: string
// URL: string
DOI: string
// journalAbbreviation: string
// language: string
author: Array<{ family: string, given: string }>
issued: {
"date-parts": Array<string>
},
}
export interface CrossrefArticle {
DOI: string;
issue: number;
type: string;
title: string[];
author: Array<{ family: string; given: string }>;
// "container-title-short": string;
"short-container-title": string;
"container-title": string;
abstract?: string;
published: {
"date-parts": string[];
};
issued: {
"date-parts": string[];
};
}
export interface RawArticle {
message: CrossrefArticle
}
export type SrcArticle = CrossrefArticle | CslJson
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment