initial public commit

This commit is contained in:
2026-02-22 21:26:15 -05:00
commit 9dbf7ae796
100 changed files with 18823 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
export declare const __dirname: string;
+2
View File
@@ -0,0 +1,2 @@
import { Twt } from './types.ts';
export default function hashTwt(twt: Twt): string;
+5
View File
@@ -0,0 +1,5 @@
export type * from './types.ts';
export { default as hashTwt } from './hashTwt.ts';
export { default as loadAndParseTwtxtFile } from './loadAndParseTwtxt.ts';
export { default as parseTwtxt } from './parseTwtxt.ts';
export { base32Encode } from './utils.ts';
+14
View File
@@ -0,0 +1,14 @@
export default function loadAndParseTwtxtFile(url?: string): Promise<{
lastModified: string;
following: import('./types.ts').Twttr[];
metadata: import('./types.ts').Metadata;
twts: {
content: string;
created: string;
createdUTC: string;
hash: string;
replyHash: string | undefined;
replyNick: string | undefined;
replyUrl: string | undefined;
}[];
}>;
+18
View File
@@ -0,0 +1,18 @@
import { Metadata, Twttr } from './types.ts';
/**
* @param twtxt
* @returns object containing: following, metadata, twts
*/
export default function parseTwtxt(twtxt: string): {
following: Twttr[];
metadata: Metadata;
twts: {
content: string;
created: string;
createdUTC: string;
hash: string;
replyHash: string | undefined;
replyNick: string | undefined;
replyUrl: string | undefined;
}[];
};
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+2318
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+31
View File
@@ -0,0 +1,31 @@
export interface LoadAndParseTwtxtWithCacheConfig {
cacheKeyPrefix: string;
onLoad?: (data: Twtxt) => void;
user?: Twttr;
}
export interface Metadata {
[key: string]: string | string[];
}
export interface Twt {
avatar?: string;
content: string;
created: string;
createdUTC: string;
hash?: string;
nick?: string;
noDom?: boolean;
replyHash?: string;
replyNick?: string;
replyUrl?: string;
url?: string;
}
export interface Twttr {
avatar?: string;
nick: string;
url: string;
}
export interface Twtxt {
following: Twttr[];
metadata: Metadata;
twts: Twt[];
}
+2
View File
@@ -0,0 +1,2 @@
export declare const base32Encode: (payload: string | Uint8Array<ArrayBufferLike>) => any;
export declare const getValueOrFirstEntry: (value: unknown | unknown[]) => any;