feat(api): create api calls for google fonts and fontshare
This commit is contained in:
@@ -7,13 +7,13 @@
|
|||||||
* @see https://fontshare.com
|
* @see https://fontshare.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { api } from '$shared/api/api';
|
||||||
|
import { buildQueryString } from '$shared/lib/utils';
|
||||||
|
import type { QueryParams } from '$shared/lib/utils';
|
||||||
import type {
|
import type {
|
||||||
FontshareApiModel,
|
FontshareApiModel,
|
||||||
FontshareFont,
|
FontshareFont,
|
||||||
} from '$entities/Font/model/types/fontshare';
|
} from '../../model/types/fontshare';
|
||||||
import { api } from '$shared/api/api';
|
|
||||||
import { buildQueryString } from '$shared/utils';
|
|
||||||
import type { QueryParams } from '$shared/utils';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fontshare API parameters
|
* Fontshare API parameters
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
* @see https://developers.google.com/fonts/docs/developer_api
|
* @see https://developers.google.com/fonts/docs/developer_api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { api } from '$shared/api/api';
|
||||||
|
import { buildQueryString } from '$shared/lib/utils';
|
||||||
|
import type { QueryParams } from '$shared/lib/utils';
|
||||||
import type {
|
import type {
|
||||||
FontItem,
|
FontItem,
|
||||||
GoogleFontsApiModel,
|
GoogleFontsApiModel,
|
||||||
} from '$entities/Font/model/types/google';
|
} from '../../model/types/google';
|
||||||
import { api } from '$shared/api/api';
|
|
||||||
import { buildQueryString } from '$shared/utils';
|
|
||||||
import type { QueryParams } from '$shared/utils';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google Fonts API parameters
|
* Google Fonts API parameters
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import type {
|
|
||||||
FontshareFont,
|
|
||||||
GoogleFontItem,
|
|
||||||
} from '$entities/Font/model/types';
|
|
||||||
import {
|
import {
|
||||||
describe,
|
describe,
|
||||||
expect,
|
expect,
|
||||||
it,
|
it,
|
||||||
} from 'vitest';
|
} from 'vitest';
|
||||||
|
import type {
|
||||||
|
FontshareFont,
|
||||||
|
GoogleFontItem,
|
||||||
|
} from '../../model/types';
|
||||||
import {
|
import {
|
||||||
normalizeFontshareFont,
|
normalizeFontshareFont,
|
||||||
normalizeFontshareFonts,
|
normalizeFontshareFonts,
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import type {
|
|||||||
FontCategory,
|
FontCategory,
|
||||||
FontStyleUrls,
|
FontStyleUrls,
|
||||||
FontSubset,
|
FontSubset,
|
||||||
} from '$entities/Font/model/types';
|
FontshareFont,
|
||||||
import type { FontshareFont } from '$entities/Font/model/types/fontshare';
|
GoogleFontItem,
|
||||||
import type { GoogleFontItem } from '$entities/Font/model/types/google';
|
UnifiedFont,
|
||||||
import type { UnifiedFont } from '$entities/Font/model/types/normalize';
|
} from '../../model/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map Google Fonts category to unified FontCategory
|
* Map Google Fonts category to unified FontCategory
|
||||||
@@ -271,4 +271,4 @@ export function normalizeFontshareFonts(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Re-export UnifiedFont for backward compatibility
|
// Re-export UnifiedFont for backward compatibility
|
||||||
export type { UnifiedFont } from '$entities/Font/model/types/normalize';
|
export type { UnifiedFont } from '../../model/types/normalize';
|
||||||
|
|||||||
Reference in New Issue
Block a user