From fb732ace529fe864998380945efc2704f4b0a5a4 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Sun, 21 Apr 2024 22:15:03 +0800 Subject: [PATCH] style(api): add type declaration --- packages/api/src/pageview.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/api/src/pageview.ts b/packages/api/src/pageview.ts index 58a0aa39d77..1f57322ad15 100644 --- a/packages/api/src/pageview.ts +++ b/packages/api/src/pageview.ts @@ -1,4 +1,8 @@ -import { getArticleCounter, updateArticleCounter } from './articleCounter.js'; +import { + type GetArticleCounterResponse, + getArticleCounter, + updateArticleCounter, +} from './articleCounter.js'; import { type BaseAPIOptions } from './utils.js'; interface GetPageviewOptions extends BaseAPIOptions { @@ -22,7 +26,7 @@ export const getPageview = ({ lang, paths, signal, -}: GetPageviewOptions) => +}: GetPageviewOptions): Promise => getArticleCounter({ serverURL, lang, @@ -40,7 +44,9 @@ export interface UpdatePageviewOptions extends BaseAPIOptions { path: string; } -export const updatePageview = (options: UpdatePageviewOptions) => +export const updatePageview = ( + options: UpdatePageviewOptions, +): Promise => updateArticleCounter({ ...options, type: 'time',