diff --git a/src/api/authenticated_api.ts b/src/api/authenticated_api.ts index 457a4dd..a104128 100644 --- a/src/api/authenticated_api.ts +++ b/src/api/authenticated_api.ts @@ -25,7 +25,7 @@ class LocalStorageConfig { } export class AuthenticatedAPI extends BlueskyAPI { - user: json; + override user: json; constructor() { let config = new LocalStorageConfig(); @@ -128,7 +128,7 @@ export class AuthenticatedAPI extends BlueskyAPI { }); } - resetTokens() { + override resetTokens() { delete this.user.avatar; super.resetTokens(); } diff --git a/src/api/identity.ts b/src/api/identity.ts index e107483..c78c99c 100644 --- a/src/api/identity.ts +++ b/src/api/identity.ts @@ -28,7 +28,7 @@ export async function pdsEndpointForDID(did: string): Promise { let json = text.trim().length > 0 ? JSON.parse(text) : undefined; if (response.status == 200) { - let service = (json.service || []).find(s => s.id == '#atproto_pds'); + let service = (json.service || []).find((s: json) => s.id == '#atproto_pds'); if (service) { return service.serviceEndpoint.replace('https://', ''); diff --git a/src/models/embeds.js b/src/models/embeds.js index 5283310..66d3856 100644 --- a/src/models/embeds.js +++ b/src/models/embeds.js @@ -1,5 +1,5 @@ import { ATProtoRecord } from './records.js'; -import { Post, PostDataError, parseViewRecord } from './posts.js'; +import { PostDataError, parseViewRecord } from './posts.js'; /** * Base class for embed objects. diff --git a/src/models/posts.js b/src/models/posts.js index 23a3a36..6d6664a 100644 --- a/src/models/posts.js +++ b/src/models/posts.js @@ -183,6 +183,12 @@ export class Post extends BasePost { */ pageRoot; + /** + * Post's direct replies (if it's displayed in a thread). + * @type {AnyPost[]} + */ + replies; + /** * Info about the author of the "grandparent" post. Included only in feedPost views, for the purposes * of feed filtering algorithm. @@ -342,12 +348,6 @@ export class Post extends BasePost { return this.linkToAuthor + '/post/' + this.rkey; } - /** @returns {string} */ - get didLinkToAuthor() { - let { repo } = atURI(this.uri); - return `https://bsky.app/profile/${repo}`; - } - /** @returns {string} */ get text() { return this.record.text; diff --git a/src/services/lycan.ts b/src/services/lycan.ts index 2a4129c..91445af 100644 --- a/src/services/lycan.ts +++ b/src/services/lycan.ts @@ -68,15 +68,15 @@ export class DevLycan extends Lycan { this.localLycan = new BlueskyAPI(host); } - async getImportStatus() { + override async getImportStatus() { return await this.localLycan.getRequest('blue.feeds.lycan.getImportStatus', { user: accountAPI.user.did }); } - async startImport() { + override async startImport() { await this.localLycan.postRequest('blue.feeds.lycan.startImport', { user: accountAPI.user.did }); } - async makeQuery(collection: string, query: string, cursor: string | undefined) { + override async makeQuery(collection: string, query: string, cursor: string | undefined) { let params: Record = { collection, query, user: accountAPI.user.did }; if (cursor) params.cursor = cursor; diff --git a/tsconfig.json b/tsconfig.json index 7e2b0e8..d5e0006 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,24 @@ { "compilerOptions": { - "target": "es2022", - "module": "nodenext", - "moduleResolution": "nodenext", + "target": "es2024", + "module": "esnext", + "moduleResolution": "bundler", + "moduleDetection": "force", + "isolatedModules": true, + "verbatimModuleSyntax": true, "noEmit": true, "checkJs": true, "strict": true, - "noImplicitAny": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, "exactOptionalPropertyTypes": true, - "useUnknownInCatchVariables": false + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noUncheckedSideEffectImports": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "useUnknownInCatchVariables": false, }, "include": ["src/**/*.js", "src/**/*.ts", "lib/**/*.d.ts"] }