rename type

This commit is contained in:
Alan Hamlett
2024-08-27 16:41:26 +02:00
parent 115789dc6e
commit 9820c22a28
2 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ import browser, { Tabs } from 'webextension-polyfill';
/* eslint-disable no-fallthrough */
/* eslint-disable default-case */
import moment from 'moment';
import { SiteInfo } from 'src/types/sites';
import { OptionalHeartbeat } from 'src/types/sites';
import { getOperatingSystem } from '../utils';
import { changeExtensionStatus } from '../utils/changeExtensionStatus';
import getDomainFromUrl, { getDomain } from '../utils/getDomainFromUrl';
@@ -139,7 +139,7 @@ class WakaTimeCore {
const heartbeat = (
(await browser.tabs.sendMessage(tab.id, { task: 'getHeartbeatFromPage', url })) as {
heartbeat?: SiteInfo;
heartbeat?: OptionalHeartbeat;
}
).heartbeat;

View File

@@ -14,7 +14,7 @@ export enum KnownSite {
zoom = 'zoom',
}
export interface SiteInfo {
export interface OptionalHeartbeat {
branch?: string | null;
category?: Category | null;
entity?: string;
@@ -23,7 +23,7 @@ export interface SiteInfo {
project?: string | null;
}
export type HeartbeatParser = (url: string) => SiteInfo | undefined;
export type HeartbeatParser = (url: string) => OptionalHeartbeat | undefined;
export interface SiteParser {
parser: HeartbeatParser;