diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000000..a40510e62c7 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +_docs diff --git a/.eslintrc.js b/.eslintrc.js index e0150cca7d1..b751ebc8c42 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -103,11 +103,8 @@ module.exports = { }, }, { - // We don't need amazing docs in our spec files files: ["src/**/*.ts"], rules: { - "tsdoc/syntax": "error", - // We use some select jsdoc rules as the tsdoc linter has only one rule "jsdoc/no-types": "error", "jsdoc/empty-tags": "error", "jsdoc/check-property-names": "error", diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 451ea064248..dc155b6cedf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,12 +39,6 @@ jobs: - name: 🧮 Checkout code uses: actions/checkout@v4 - - name: 🧮 Checkout gh-pages - uses: actions/checkout@v4 - with: - ref: gh-pages - path: _docs - - name: 🔧 Yarn cache uses: actions/setup-node@v4 with: @@ -53,26 +47,21 @@ jobs: - name: 🔨 Install dependencies run: "yarn install --frozen-lockfile" - - name: 🔨 Install symlinks - run: | - sudo apt-get update - sudo apt-get install -y symlinks - - name: 📖 Generate docs - run: | - yarn tpv purge --yes --out _docs --stale --major 10 - yarn gendoc - symlinks -rc _docs - find _docs -xtype l -delete + run: yarn gendoc - - name: 🔨 Set up git - run: | - git config --global user.email "releases@riot.im" - git config --global user.name "RiotRobot" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: _docs - - name: 🚀 Deploy - run: | - git add . --all - git commit -m "Update docs" - git push - working-directory: _docs + docs-deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: docs + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 4e1070d1c96..8be2b77a6fc 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -83,13 +83,6 @@ jobs: - name: Generate Docs run: "yarn run gendoc --treatWarningsAsErrors" - # Upload artifact duplicates symlink contents so we do this to save 75% space - - name: Flatten symlink and write _redirects - run: | - find _docs -mindepth 1 -maxdepth 1 ! -type f ! -name stable -printf '/%f/* /stable/:splat\n' > _docs/_redirects - find _docs -mindepth 1 -maxdepth 1 -type l -delete - find _docs -mindepth 1 -maxdepth 1 -type d -execdir mv {} stable \; -quit - - name: Upload Artifact uses: actions/upload-artifact@v4 with: diff --git a/README.md b/README.md index f194a72715e..74a2f7be0bf 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,7 @@ host the API reference from the source files like this: ``` $ yarn gendoc - $ cd _docs + $ cd docs $ python -m http.server 8005 ``` diff --git a/package.json b/package.json index 1911d97d170..49a1cb9adf7 100644 --- a/package.json +++ b/package.json @@ -121,13 +121,11 @@ "prettier": "3.2.5", "rimraf": "^5.0.0", "ts-node": "^10.9.1", - "typedoc": "^0.24.0", + "typedoc": "^0.25.10", "typedoc-plugin-coverage": "^3.0.0", "typedoc-plugin-mdn-links": "^3.0.3", "typedoc-plugin-missing-exports": "^2.0.0", - "typedoc-plugin-versions": "^0.2.3", - "typedoc-plugin-versions-cli": "^0.1.12", - "typescript": "^5.0.0" + "typescript": "^5.3.3" }, "@casualbot/jest-sonar-reporter": { "outputDirectory": "coverage", diff --git a/src/@types/requests.ts b/src/@types/requests.ts index e67fb873b76..d6b7ff75fa2 100644 --- a/src/@types/requests.ts +++ b/src/@types/requests.ts @@ -162,11 +162,21 @@ export interface ICreateRoomOpts { } export interface IRoomDirectoryOptions { + /** + * The remote server to query for the room list. + * Optional. If unspecified, get the local homeserver's public room list. + */ server?: string; + /** + * Maximum number of entries to return + */ limit?: number; + /** + * Token to paginate from + */ since?: string; - // Filter parameters + /** Filter parameters */ filter?: { // String to search for generic_search_term?: string; diff --git a/src/client.ts b/src/client.ts index 3b489ad52db..1580634e06a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -3286,7 +3286,7 @@ export class MatrixClient extends TypedEventEmitter { @@ -8480,12 +8479,7 @@ export class MatrixClient extends TypedEventEmitter { @@ -9008,8 +9002,9 @@ export class MatrixClient extends TypedEventEmitter { let e2eKeys; diff --git a/src/crypto/index.ts b/src/crypto/index.ts index 0f6018b8e15..0d8f057eabc 100644 --- a/src/crypto/index.ts +++ b/src/crypto/index.ts @@ -473,8 +473,6 @@ export class Crypto extends TypedEventEmitter { diff --git a/src/http-api/fetch.ts b/src/http-api/fetch.ts index fbe842f1e9a..274f39f0d41 100644 --- a/src/http-api/fetch.ts +++ b/src/http-api/fetch.ts @@ -111,8 +111,8 @@ export class FetchHttpApi { * * @param body - The HTTP JSON body. * - * @param opts - additional options. - * When `opts.doNotAttemptTokenRefresh` is true, token refresh will not be attempted + * @param paramOpts - additional options. + * When `paramOpts.doNotAttemptTokenRefresh` is true, token refresh will not be attempted * when an expired token is encountered. Used to only attempt token refresh once. * * @returns Promise which resolves to diff --git a/src/matrixrtc/MatrixRTCSession.ts b/src/matrixrtc/MatrixRTCSession.ts index 03871bb90e8..1695ea6d703 100644 --- a/src/matrixrtc/MatrixRTCSession.ts +++ b/src/matrixrtc/MatrixRTCSession.ts @@ -610,7 +610,7 @@ export class MatrixRTCSession extends TypedEventEmitter { const eventId = event.getId(); diff --git a/src/models/room-state.ts b/src/models/room-state.ts index 52d520be177..e08f4859ffb 100644 --- a/src/models/room-state.ts +++ b/src/models/room-state.ts @@ -297,13 +297,15 @@ export class RoomState extends TypedEventEmitter /** * Get state events from the state of the room. * @param eventType - The event type of the state event. - * @param stateKey - Optional. The state_key of the state event. If - * this is `undefined` then all matching state events will be - * returned. - * @returns A list of events if state_key was - * `undefined`, else a single event (or null if no match found). + * @returns A list of events */ public getStateEvents(eventType: EventType | string): MatrixEvent[]; + /** + * Get state events from the state of the room. + * @param eventType - The event type of the state event. + * @param stateKey - The state_key of the state event. + * @returns A single event (or null if no match found). + */ public getStateEvents(eventType: EventType | string, stateKey: string): MatrixEvent | null; public getStateEvents(eventType: EventType | string, stateKey?: string): MatrixEvent[] | MatrixEvent | null { if (!this.events.has(eventType)) { diff --git a/src/oidc/tokenRefresher.ts b/src/oidc/tokenRefresher.ts index 79ef9442276..84b773531b9 100644 --- a/src/oidc/tokenRefresher.ts +++ b/src/oidc/tokenRefresher.ts @@ -113,10 +113,10 @@ export class OidcTokenRefresher { * * This function is intended to be overriden by the consumer when persistence is necessary. * - * @param accessToken - new access token - * @param refreshToken - OPTIONAL new refresh token + * @param tokens.accessToken - new access token + * @param tokens.refreshToken - OPTIONAL new refresh token */ - public async persistTokens(_tokens: { accessToken: string; refreshToken?: string }): Promise { + public async persistTokens(tokens: { accessToken: string; refreshToken?: string }): Promise { // NOOP } diff --git a/src/sliding-sync-sdk.ts b/src/sliding-sync-sdk.ts index bfe32448bd2..2b3399664ad 100644 --- a/src/sliding-sync-sdk.ts +++ b/src/sliding-sync-sdk.ts @@ -455,7 +455,7 @@ export class SlidingSyncSdk { * @returns A promise which resolves once the room has been added to the * store. */ - public async peek(_roomId: string): Promise { + public async peek(roomId: string): Promise { return null!; // TODO } diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 187a9443fe9..92b4862de1c 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -1235,7 +1235,7 @@ export class MatrixCall extends TypedEventEmitter { @@ -1292,7 +1292,7 @@ export class MatrixCall extends TypedEventEmitter