Skip to content

Commit

Permalink
style(api): add type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Apr 21, 2024
1 parent 527e696 commit fb732ac
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/api/src/pageview.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -22,7 +26,7 @@ export const getPageview = ({
lang,
paths,
signal,
}: GetPageviewOptions) =>
}: GetPageviewOptions): Promise<GetArticleCounterResponse> =>
getArticleCounter({
serverURL,
lang,
Expand All @@ -40,7 +44,9 @@ export interface UpdatePageviewOptions extends BaseAPIOptions {
path: string;
}

export const updatePageview = (options: UpdatePageviewOptions) =>
export const updatePageview = (
options: UpdatePageviewOptions,
): Promise<GetArticleCounterResponse> =>
updateArticleCounter({
...options,
type: 'time',
Expand Down

0 comments on commit fb732ac

Please sign in to comment.