mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-09 21:07:46 +00:00
enums to objects
This commit is contained in:
@@ -22,10 +22,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
|
||||
let copyText = CopyStatus.Copy;
|
||||
async function handleCopy() {
|
||||
|
||||
@@ -11,11 +11,11 @@ client.setEndpoint(PUBLIC_APPWRITE_ENDPOINT).setProject('console');
|
||||
const account = new Account(client);
|
||||
const teams = new Teams(client);
|
||||
|
||||
enum BillingPlan {
|
||||
STARTER = 'tier-0',
|
||||
PRO = 'tier-1',
|
||||
SCALE = 'tier-2'
|
||||
}
|
||||
const BillingPlan = {
|
||||
STARTER: 'tier-0',
|
||||
PRO: 'tier-1',
|
||||
SCALE: 'tier-2'
|
||||
} as const;
|
||||
|
||||
export async function createSource(
|
||||
ref: string | null,
|
||||
|
||||
@@ -20,51 +20,51 @@ export const versions: Readonly<Array<Omit<Version, 'cloud'>>> = allVersions.fil
|
||||
(v) => v !== 'cloud'
|
||||
);
|
||||
|
||||
export enum Service {
|
||||
Account = 'account',
|
||||
Avatars = 'avatars',
|
||||
Databases = 'databases',
|
||||
Functions = 'functions',
|
||||
Messaging = 'messaging',
|
||||
Health = 'health',
|
||||
Locale = 'locale',
|
||||
Storage = 'storage',
|
||||
Teams = 'teams',
|
||||
Users = 'users'
|
||||
}
|
||||
export const Service = {
|
||||
Account: 'account',
|
||||
Avatars: 'avatars',
|
||||
Databases: 'databases',
|
||||
Functions: 'functions',
|
||||
Messaging: 'messaging',
|
||||
Health: 'health',
|
||||
Locale: 'locale',
|
||||
Storage: 'storage',
|
||||
Teams: 'teams',
|
||||
Users: 'users'
|
||||
} as const;
|
||||
|
||||
export enum Platform {
|
||||
ClientWeb = 'client-web',
|
||||
ClientFlutter = 'client-flutter',
|
||||
ClientReactNative = 'client-react-native',
|
||||
ClientApple = 'client-apple',
|
||||
ClientAndroidKotlin = 'client-android-kotlin',
|
||||
ClientAndroidJava = 'client-android-java',
|
||||
ClientGraphql = 'client-graphql',
|
||||
ClientRest = 'client-rest',
|
||||
ServerNodeJs = 'server-nodejs',
|
||||
ServerPython = 'server-python',
|
||||
ServerDart = 'server-dart',
|
||||
ServerPhp = 'server-php',
|
||||
ServerRuby = 'server-ruby',
|
||||
ServerDotNet = 'server-dotnet',
|
||||
ServerDeno = 'server-deno',
|
||||
ServerGo = 'server-go',
|
||||
ServerSwift = 'server-swift',
|
||||
ServerKotlin = 'server-kotlin',
|
||||
ServerJava = 'server-java',
|
||||
ServerGraphql = 'server-graphql',
|
||||
ServerRest = 'server-rest'
|
||||
}
|
||||
export const Platform = {
|
||||
ClientWeb: 'client-web',
|
||||
ClientFlutter: 'client-flutter',
|
||||
ClientReactNative: 'client-react-native',
|
||||
ClientApple: 'client-apple',
|
||||
ClientAndroidKotlin: 'client-android-kotlin',
|
||||
ClientAndroidJava: 'client-android-java',
|
||||
ClientGraphql: 'client-graphql',
|
||||
ClientRest: 'client-rest',
|
||||
ServerNodeJs: 'server-nodejs',
|
||||
ServerPython: 'server-python',
|
||||
ServerDart: 'server-dart',
|
||||
ServerPhp: 'server-php',
|
||||
ServerRuby: 'server-ruby',
|
||||
ServerDotNet: 'server-dotnet',
|
||||
ServerDeno: 'server-deno',
|
||||
ServerGo: 'server-go',
|
||||
ServerSwift: 'server-swift',
|
||||
ServerKotlin: 'server-kotlin',
|
||||
ServerJava: 'server-java',
|
||||
ServerGraphql: 'server-graphql',
|
||||
ServerRest: 'server-rest'
|
||||
} as const;
|
||||
|
||||
export enum Framework {
|
||||
NextJs = 'Next.js',
|
||||
SvelteKit = 'SvelteKit',
|
||||
VueJs = 'Vue.js',
|
||||
Nuxt3 = 'Nuxt3',
|
||||
Astro = 'Astro',
|
||||
Remix = 'Remix'
|
||||
}
|
||||
export const Framework = {
|
||||
NextJs: 'Next.js',
|
||||
SvelteKit: 'SvelteKit',
|
||||
VueJs: 'Vue.js',
|
||||
Nuxt3: 'Nuxt3',
|
||||
Astro: 'Astro',
|
||||
Remix: 'Remix'
|
||||
} as const;
|
||||
|
||||
export const platformMap: Record<Language | string, string> = {
|
||||
[Platform.ClientApple]: 'Apple',
|
||||
|
||||
@@ -60,10 +60,10 @@ export interface Property {
|
||||
} & OpenAPIV3.ReferenceObject;
|
||||
}
|
||||
|
||||
export enum ModelType {
|
||||
REST = 'REST',
|
||||
GRAPHQL = 'GraphQL'
|
||||
}
|
||||
export const ModelType = {
|
||||
REST: 'REST',
|
||||
GRAPHQL: 'GraphQL'
|
||||
} as const;
|
||||
|
||||
function getExamples(version: string) {
|
||||
switch (version) {
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
const insideMultiCode = hasContext('multi-code');
|
||||
const selected = insideMultiCode ? getContext<CodeContext>('multi-code').selected : null;
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
|
||||
let copyText = $state(CopyStatus.Copy);
|
||||
async function handleCopy() {
|
||||
|
||||
@@ -48,10 +48,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
|
||||
let copyText = $state(CopyStatus.Copy);
|
||||
|
||||
async function handleCopy() {
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
import MainFooter from '../../lib/components/MainFooter.svelte';
|
||||
import Copy from './Copy.svelte';
|
||||
|
||||
const title = 'Assets' + TITLE_SUFFIX;
|
||||
const title: 'Assets' + TITLE_SUFFIX;
|
||||
const description =
|
||||
"This page features Appwrite's key brand assets including the logotype, colors, product visuals, and practical guidelines for their usage.";
|
||||
const ogImage = DEFAULT_HOST + '/images/open-graph/website.png';
|
||||
|
||||
enum Section {
|
||||
NAMING = 'Naming',
|
||||
LOGOTYPE = 'Logotype',
|
||||
LOGOMARK = 'Logomark',
|
||||
COLORS = 'Brand colors',
|
||||
VISUALS = 'Product visuals',
|
||||
CONTACT = 'Contact us'
|
||||
}
|
||||
const Section = {
|
||||
NAMING: 'Naming',
|
||||
LOGOTYPE: 'Logotype',
|
||||
LOGOMARK: 'Logomark',
|
||||
COLORS: 'Brand colors',
|
||||
VISUALS: 'Product visuals',
|
||||
CONTACT: 'Contact us'
|
||||
} as const
|
||||
|
||||
const getSectionId = (section: Section) => section.toLowerCase().replace(/\s/g, '-');
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
const sharingOptions = socialSharingOptions.filter((option) => option.label !== 'YCombinator');
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
|
||||
let copyText = CopyStatus.Copy;
|
||||
async function handleCopy() {
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
const rateTime = method['rate-time'];
|
||||
const rateLimit = method['rate-limit'];
|
||||
|
||||
enum RateKeys {
|
||||
'ip' = 'IP',
|
||||
'userId' = 'USER ID',
|
||||
'url' = 'URL',
|
||||
'phone' = 'PHONE',
|
||||
'token' = 'TOKEN',
|
||||
'method' = 'METHOD',
|
||||
'email' = 'EMAIL'
|
||||
}
|
||||
const RateKeys = {
|
||||
ip: 'IP',
|
||||
userId: 'USER ID',
|
||||
url: 'URL',
|
||||
phone: 'PHONE',
|
||||
token: 'TOKEN',
|
||||
method: 'METHOD',
|
||||
email: 'EMAIL'
|
||||
} as const;
|
||||
|
||||
function hasMultipleKeys(keys: string | string[]): keys is string[] {
|
||||
if (Array.isArray(keys)) {
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
|
||||
let copyText = CopyStatus.Copy;
|
||||
async function handleCopy() {
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
|
||||
let copyText = CopyStatus.Copy;
|
||||
async function handleCopy() {
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
let copyText = CopyStatus.Copy;
|
||||
async function handleCopy() {
|
||||
await copy(content);
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
const insideMultiCode = hasContext('multi-code');
|
||||
const selected = insideMultiCode ? getContext<CodeContext>('multi-code').selected : null;
|
||||
|
||||
const enum CopyStatus {
|
||||
Copy = 'Copy',
|
||||
Copied = 'Copied!'
|
||||
}
|
||||
const CopyStatus = {
|
||||
Copy: 'Copy',
|
||||
Copied: 'Copied!'
|
||||
} as const;
|
||||
|
||||
let copyText = CopyStatus.Copy;
|
||||
async function handleCopy() {
|
||||
|
||||
Reference in New Issue
Block a user