github-url-detection 10.2.3 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,65 +1,304 @@
1
+ /* Examples added by add-examples-to-dts.ts */
1
2
  export declare const is404: () => boolean;
2
3
  export declare const is500: () => boolean;
3
4
  export declare const isPasswordConfirmation: () => boolean;
4
5
  export declare const isLoggedIn: () => boolean;
6
+ /**
7
+ * @example https://github.com/sindresorhus/refined-github/blame/master/package.json
8
+ */
5
9
  export declare const isBlame: (url?: URL | HTMLAnchorElement | Location) => boolean;
10
+ /**
11
+ * @example https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f
12
+ * @example https://github.com/sindresorhus/refined-github/commit/5b614
13
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
14
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d79
15
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
16
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d79
17
+ */
6
18
  export declare const isCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
7
19
  export declare const isCommitList: (url?: URL | HTMLAnchorElement | Location) => boolean;
20
+ /**
21
+ * @example https://github.com/sindresorhus/refined-github/commits/master?page=2
22
+ * @example https://github.com/sindresorhus/refined-github/commits/test-branch
23
+ * @example https://github.com/sindresorhus/refined-github/commits/0.13.0
24
+ * @example https://github.com/sindresorhus/refined-github/commits/230c2
25
+ * @example https://github.com/sindresorhus/refined-github/commits/230c2935fc5aea9a681174ddbeba6255ca040d63
26
+ * @example https://github.com/sindresorhus/refined-github/commits?author=fregante
27
+ * @example https://github.com/sindresorhus/runs/commits/
28
+ */
8
29
  export declare const isRepoCommitList: (url?: URL | HTMLAnchorElement | Location) => boolean;
30
+ /**
31
+ * @example https://github.com/sindresorhus/refined-github/compare
32
+ * @example https://github.com/sindresorhus/refined-github/compare/
33
+ * @example https://github.com/sindresorhus/refined-github/compare/master...branch-name
34
+ * @example https://github.com/sindresorhus/refined-github/compare/master...branch-name?quick_pull=1
35
+ * @example https://github.com/sindresorhus/refined-github/compare/branch-1...branch-2?quick_pull=1
36
+ * @example https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1
37
+ */
9
38
  export declare const isCompare: (url?: URL | HTMLAnchorElement | Location) => boolean;
39
+ /**
40
+ * @example https://github.com/brookhong/Surfingkeys/wiki/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d
41
+ * @example https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d
42
+ */
10
43
  export declare const isCompareWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
44
+ /**
45
+ * @example https://github.com///
46
+ * @example https://github.com//
47
+ * @example https://github.com/
48
+ * @example https://github.com
49
+ * @example https://github.com/orgs/test/dashboard
50
+ * @example https://github.com/dashboard/index/2
51
+ * @example https://github.com//dashboard
52
+ * @example https://github.com/dashboard
53
+ * @example https://github.com/orgs/edit/dashboard
54
+ * @example https://github.big-corp.com/
55
+ * @example https://not-github.com/
56
+ * @example https://my-little-hub.com/
57
+ * @example https://github.com/?tab=repositories
58
+ * @example https://github.com/?tab=stars
59
+ * @example https://github.com/?tab=followers
60
+ * @example https://github.com/?tab=following
61
+ * @example https://github.com/?tab=overview
62
+ * @example https://github.com?search=1
63
+ * @example https://github.com/dashboard-feed
64
+ */
11
65
  export declare const isDashboard: (url?: URL | HTMLAnchorElement | Location) => boolean;
66
+ /**
67
+ * @example https://github.big-corp.com/
68
+ * @example https://not-github.com/
69
+ * @example https://my-little-hub.com/
70
+ * @example https://my-little-hub.com/gist
71
+ * @example https://my-little-hub.com/gist/in-fragrante
72
+ * @example https://gist.my-little-hub.com/in-fragrante
73
+ */
12
74
  export declare const isEnterprise: (url?: URL | HTMLAnchorElement | Location) => boolean;
75
+ /**
76
+ * @example https://gist.github.com
77
+ * @example http://gist.github.com
78
+ * @example https://gist.github.com/new
79
+ * @example https://gist.github.com/fregante/2205329b71218fa2c1d3
80
+ * @example https://gist.github.com/fregante/2205329b71218fa2c1d3/d1ebf7d9cfaba4d4596d2ea9174e202479a5f9ad
81
+ * @example https://gist.github.com/sindresorhus/0ea3c2845718a0a0f0beb579ff14f064
82
+ * @example https://my-little-hub.com/gist
83
+ * @example https://gist.github.com/kidonng/0d16c7f17045f486751fad1b602204a0/revisions
84
+ * @example https://gist.github.com/fregante
85
+ * @example https://gist.github.com/github
86
+ * @example https://gist.github.com/babel
87
+ * @example https://my-little-hub.com/gist/in-fragrante
88
+ * @example https://gist.my-little-hub.com/in-fragrante
89
+ */
13
90
  export declare const isGist: (url?: URL | HTMLAnchorElement | Location) => boolean;
91
+ /**
92
+ * @example https://github.com/issues
93
+ * @example https://github.com/issues?q=is%3Apr+is%3Aopen
94
+ * @example https://github.com/issues/assigned
95
+ * @example https://github.com/issues/mentioned
96
+ * @example https://github.com/pulls
97
+ * @example https://github.com/pulls?q=issues
98
+ * @example https://github.com/pulls/assigned
99
+ * @example https://github.com/pulls/mentioned
100
+ * @example https://github.com/pulls/review-requested
101
+ */
14
102
  export declare const isGlobalIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
103
+ /**
104
+ * @example https://github.com/search?q=refined-github&ref=opensearch
105
+ */
15
106
  export declare const isGlobalSearchResults: (url?: URL | HTMLAnchorElement | Location) => boolean;
107
+ /**
108
+ * @example https://github.com/sindresorhus/refined-github/issues/146
109
+ */
16
110
  export declare const isIssue: (url?: URL | HTMLAnchorElement | Location) => boolean;
17
111
  export declare const isIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
18
112
  export declare const isConversation: (url?: URL | HTMLAnchorElement | Location) => boolean;
113
+ /**
114
+ * @example https://github.com/sindresorhus/refined-github/labels
115
+ * @example https://github.com/sindresorhus/refined-github/labels/
116
+ */
19
117
  export declare const isLabelList: (url?: URL | HTMLAnchorElement | Location) => boolean;
118
+ /**
119
+ * @example https://github.com/kubernetes/kubernetes/milestone/56
120
+ */
20
121
  export declare const isMilestone: (url?: URL | HTMLAnchorElement | Location) => boolean;
122
+ /**
123
+ * @example https://github.com/sindresorhus/refined-github/milestones
124
+ */
21
125
  export declare const isMilestoneList: (url?: URL | HTMLAnchorElement | Location) => boolean;
126
+ /**
127
+ * @example https://github.com/sindresorhus/refined-github/new/main
128
+ */
22
129
  export declare const isNewFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
130
+ /**
131
+ * @example https://github.com/sindresorhus/refined-github/issues/new
132
+ */
23
133
  export declare const isNewIssue: (url?: URL | HTMLAnchorElement | Location) => boolean;
134
+ /**
135
+ * @example https://github.com/sindresorhus/refined-github/releases/new
136
+ */
24
137
  export declare const isNewRelease: (url?: URL | HTMLAnchorElement | Location) => boolean;
138
+ /**
139
+ * @example https://github.com/tooomm/wikitest/wiki/_new
140
+ */
25
141
  export declare const isNewWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
142
+ /**
143
+ * @example https://github.com/notifications
144
+ */
26
145
  export declare const isNotifications: (url?: URL | HTMLAnchorElement | Location) => boolean;
27
146
  export declare const isOrganizationProfile: () => boolean;
28
147
  export declare const isOrganizationRepo: () => boolean;
148
+ /**
149
+ * @example https://github.com/orgs/refined-github/teams/core-team/discussions?pinned=1
150
+ * @example https://github.com/orgs/refined-github/teams/core-team/discussions/1
151
+ * @example https://github.com/orgs/refined-github/teams/core-team
152
+ */
29
153
  export declare const isTeamDiscussion: (url?: URL | HTMLAnchorElement | Location) => boolean;
30
154
  export declare const isOwnUserProfile: () => boolean;
31
155
  export declare const isOwnOrganizationProfile: () => boolean;
156
+ /**
157
+ * @example https://github.com/sindresorhus/refined-github/projects/3
158
+ * @example https://github.com/orgs/RSSNext/projects/3
159
+ */
32
160
  export declare const isProject: (url?: URL | HTMLAnchorElement | Location) => boolean;
161
+ /**
162
+ * @example https://github.com/sindresorhus/refined-github/projects
163
+ */
33
164
  export declare const isProjects: (url?: URL | HTMLAnchorElement | Location) => boolean;
165
+ /**
166
+ * @example https://github.com/tophf/mpiv/discussions/50
167
+ * @example https://github.com/orgs/community/discussions/11202
168
+ */
34
169
  export declare const isDiscussion: (url?: URL | HTMLAnchorElement | Location) => boolean;
170
+ /**
171
+ * @example https://github.com/withastro/roadmap/discussions/new?category=proposal
172
+ * @example https://github.com/orgs/community/discussions/new?category=pull-requests
173
+ */
35
174
  export declare const isNewDiscussion: (url?: URL | HTMLAnchorElement | Location) => boolean;
175
+ /**
176
+ * @example https://github.com/tophf/mpiv/discussions
177
+ * @example https://github.com/orgs/community/discussions
178
+ */
36
179
  export declare const isDiscussionList: (url?: URL | HTMLAnchorElement | Location) => boolean;
180
+ /**
181
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
182
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d79
183
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
184
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d79
185
+ * @example https://github.com/sindresorhus/refined-github/pull/148/files
186
+ * @example https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f
187
+ * @example https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f
188
+ * @example https://github.com/refined-github/refined-github/pull/148/changes
189
+ * @example https://github.com/refined-github/refined-github/pull/148/changes/1e27d799..e1aba6f
190
+ * @example https://github.com/refined-github/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641..e1aba6febb3fe38aafd1137cff28b536eeeabe7e
191
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits
192
+ * @example https://github.com/sindresorhus/refined-github/pull/148
193
+ */
37
194
  export declare const isPR: (url?: URL | HTMLAnchorElement | Location) => boolean;
195
+ /**
196
+ * @example https://github.com/sindresorhus/refined-github/pull/148/conflicts
197
+ */
38
198
  export declare const isPRConflicts: (url?: URL | HTMLAnchorElement | Location) => boolean;
39
- /** Any `isIssueOrPRList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown */
199
+ /**
200
+ * Any `isIssueOrPRList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown
201
+ * @example https://github.com/pulls
202
+ * @example https://github.com/pulls?q=issues
203
+ * @example https://github.com/sindresorhus/refined-github/pulls
204
+ * @example https://github.com/sindresorhus/refined-github/pulls/
205
+ * @example https://github.com/sindresorhus/refined-github/pulls?q=is%3Aopen+is%3Apr
206
+ * @example https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed
207
+ */
40
208
  export declare const isPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
209
+ /**
210
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
211
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d79
212
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
213
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d79
214
+ */
41
215
  export declare const isPRCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
42
216
  export declare const isPRCommit404: () => boolean;
43
217
  export declare const isPRFile404: () => boolean;
218
+ /**
219
+ * @example https://github.com/sindresorhus/refined-github/pull/148
220
+ */
44
221
  export declare const isPRConversation: (url?: URL | HTMLAnchorElement | Location) => boolean;
222
+ /**
223
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits
224
+ */
45
225
  export declare const isPRCommitList: (url?: URL | HTMLAnchorElement | Location) => boolean;
226
+ /**
227
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
228
+ * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d79
229
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
230
+ * @example https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d79
231
+ * @example https://github.com/sindresorhus/refined-github/pull/148/files
232
+ * @example https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f
233
+ * @example https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f
234
+ * @example https://github.com/refined-github/refined-github/pull/148/changes
235
+ * @example https://github.com/refined-github/refined-github/pull/148/changes/1e27d799..e1aba6f
236
+ * @example https://github.com/refined-github/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641..e1aba6febb3fe38aafd1137cff28b536eeeabe7e
237
+ */
46
238
  export declare const isPRFiles: (url?: URL | HTMLAnchorElement | Location) => boolean;
239
+ /**
240
+ * @example https://github.com/sindresorhus/refined-github/compare/master...branch-name?quick_pull=1
241
+ * @example https://github.com/sindresorhus/refined-github/compare/branch-1...branch-2?quick_pull=1
242
+ * @example https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1
243
+ */
47
244
  export declare const isQuickPR: (url?: URL | HTMLAnchorElement | Location) => boolean;
48
245
  export declare const isMergedPR: () => boolean;
49
246
  export declare const isDraftPR: () => boolean;
50
247
  export declare const isOpenConversation: () => boolean;
51
248
  export declare const isClosedConversation: () => boolean;
249
+ /**
250
+ * @example https://github.com/sindresorhus/refined-github/releases
251
+ * @example https://github.com/sindresorhus/refined-github/releases?page=2
252
+ */
52
253
  export declare const isReleases: (url?: URL | HTMLAnchorElement | Location) => boolean;
254
+ /**
255
+ * @example https://github.com/sindresorhus/refined-github/tags
256
+ * @example https://github.com/sindresorhus/refined-github/tags?after=21.8.1
257
+ */
53
258
  export declare const isTags: (url?: URL | HTMLAnchorElement | Location) => boolean;
259
+ /**
260
+ * @example https://github.com/refined-github/refined-github/releases/tag/1.20.1
261
+ * @example https://github.com/refined-github/refined-github/releases/tag/23.7.25
262
+ */
54
263
  export declare const isSingleReleaseOrTag: (url?: URL | HTMLAnchorElement | Location) => boolean;
264
+ /**
265
+ * @example https://github.com/sindresorhus/refined-github/releases
266
+ * @example https://github.com/sindresorhus/refined-github/releases?page=2
267
+ * @example https://github.com/sindresorhus/refined-github/tags
268
+ * @example https://github.com/sindresorhus/refined-github/tags?after=21.8.1
269
+ */
55
270
  export declare const isReleasesOrTags: (url?: URL | HTMLAnchorElement | Location) => boolean;
271
+ /**
272
+ * @example https://github.com/sindresorhus/refined-github/delete/master/readme.md
273
+ * @example https://github.com/sindresorhus/refined-github/delete/ghe-injection/source/background.ts
274
+ */
56
275
  export declare const isDeletingFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
276
+ /**
277
+ * @example https://github.com/sindresorhus/refined-github/edit/master/readme.md
278
+ * @example https://github.com/sindresorhus/refined-github/edit/ghe-injection/source/background.ts
279
+ */
57
280
  export declare const isEditingFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
58
281
  export declare const hasFileEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
282
+ /**
283
+ * @example https://github.com/sindresorhus/refined-github/releases/edit/v1.2.3
284
+ */
59
285
  export declare const isEditingRelease: (url?: URL | HTMLAnchorElement | Location) => boolean;
60
286
  export declare const hasReleaseEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
287
+ /**
288
+ * @example https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit
289
+ */
61
290
  export declare const isEditingWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
62
291
  export declare const hasWikiPageEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
292
+ /**
293
+ * @example https://github.com/sindresorhus/refined-github/blame/master/package.json
294
+ * @example https://github.com/sindresorhus/refined-github/issues/146
295
+ * @example https://github.com/sindresorhus/notifications/
296
+ * @example https://github.com/sindresorhus/refined-github/pull/148
297
+ * @example https://github.com/sindresorhus/refined-github/milestones/new
298
+ * @example https://github.com/sindresorhus/refined-github/milestones/1/edit
299
+ * @example https://github.com/sindresorhus/refined-github/issues/new/choose
300
+ * @example https://github.com/sindresorhus/refined-github/issues/templates/edit
301
+ */
63
302
  export declare const isRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
64
303
  export declare const hasRepoHeader: (url?: URL | HTMLAnchorElement | Location) => boolean;
65
304
  export declare const isEmptyRepoRoot: () => boolean;
@@ -67,68 +306,298 @@ export declare const isEmptyRepo: () => boolean;
67
306
  export declare const isPublicRepo: () => boolean;
68
307
  export declare const isArchivedRepo: () => boolean;
69
308
  export declare const isBlank: () => boolean;
309
+ /**
310
+ * @example https://github.com/sindresorhus/refined-github/labels/bug
311
+ * @example https://github.com/sindresorhus/refined-github/labels/implemented%20by%20github
312
+ * @example https://github.com/sindresorhus/refined-github/labels/%3Adollar%3A%20Funded%20on%20Issuehunt
313
+ * @example https://github.com/sindresorhus/refined-github/milestones/1
314
+ */
70
315
  export declare const isRepoTaxonomyIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
71
316
  export declare const isRepoIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
317
+ /**
318
+ * @example https://github.com/sindresorhus/refined-github/pulls
319
+ * @example https://github.com/sindresorhus/refined-github/pulls/
320
+ * @example https://github.com/sindresorhus/refined-github/pulls?q=is%3Aopen+is%3Apr
321
+ * @example https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed
322
+ */
72
323
  export declare const isRepoPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
324
+ /**
325
+ * @example http://github.com/sindresorhus/ava/issues
326
+ * @example https://github.com/sindresorhus/refined-github/issues
327
+ * @example https://github.com/sindresorhus/refined-github/issues/fregante
328
+ * @example https://github.com/sindresorhus/refined-github/issues/newton
329
+ * @example https://github.com/sindresorhus/refined-github/issues/wptemplates
330
+ * @example https://github.com/sindresorhus/refined-github/issues?q=is%3Aclosed+sort%3Aupdated-desc
331
+ * @example https://github.com/sindresorhus/refined-github/labels/bug
332
+ * @example https://github.com/sindresorhus/refined-github/labels/implemented%20by%20github
333
+ * @example https://github.com/sindresorhus/refined-github/labels/%3Adollar%3A%20Funded%20on%20Issuehunt
334
+ */
73
335
  export declare const isRepoIssueList: (url?: URL | HTMLAnchorElement | Location) => boolean;
336
+ /**
337
+ * @example https://github.com/sindresorhus/refined-github
338
+ * @example https://github.com/sindresorhus/refined-github/
339
+ * @example https://github.com/sindresorhus/notifications/
340
+ * @example https://github.com/sindresorhus/edit
341
+ * @example https://github.com/sindresorhus///edit
342
+ * @example https://github.com/sindresorhus/search
343
+ * @example https://github.com/sindresorhus/branches
344
+ * @example https://github.com/sindresorhus/refined-github?files=1
345
+ */
74
346
  export declare const isRepoHome: (url?: URL | HTMLAnchorElement | Location) => boolean;
75
347
  export type RepoExplorerInfo = {
76
348
  nameWithOwner: string;
77
349
  branch: string;
78
350
  filePath: string;
79
351
  };
352
+ /**
353
+ * @example https://github.com/sindresorhus/refined-github
354
+ * @example https://github.com/sindresorhus/refined-github/
355
+ * @example https://github.com/sindresorhus/notifications/
356
+ * @example https://github.com/sindresorhus/edit
357
+ * @example https://github.com/sindresorhus///edit
358
+ * @example https://github.com/sindresorhus/search
359
+ * @example https://github.com/sindresorhus/branches
360
+ * @example https://github.com/sindresorhus/refined-github?files=1
361
+ * @example https://github.com/sindresorhus/refined-github/tree/native-copy-buttons
362
+ * @example https://github.com/sindresorhus/refined-github/tree/native-copy-buttons/
363
+ * @example https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6
364
+ * @example https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6/
365
+ * @example https://github.com/sindresorhus/refined-github/tree/57bf4
366
+ * @example https://github.com/sindresorhus/refined-github/tree/master?files=1
367
+ */
80
368
  export declare const isRepoRoot: (url?: URL | HTMLAnchorElement | Location) => boolean;
369
+ /**
370
+ * @example https://github.com/sindresorhus/refined-github/search?q=diff
371
+ * @example https://github.com/sindresorhus/refined-github/search?q=diff&unscoped_q=diff&type=Issues
372
+ * @example https://github.com/sindresorhus/refined-github/search
373
+ */
81
374
  export declare const isRepoSearch: (url?: URL | HTMLAnchorElement | Location) => boolean;
375
+ /**
376
+ * @example https://github.com/sindresorhus/refined-github/settings
377
+ * @example https://github.com/sindresorhus/refined-github/settings/branches
378
+ */
82
379
  export declare const isRepoSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
380
+ /**
381
+ * @example https://github.com/sindresorhus/refined-github/settings
382
+ */
83
383
  export declare const isRepoMainSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
384
+ /**
385
+ * @example https://github.com/settings/replies
386
+ * @example https://github.com/settings/replies/88491/edit
387
+ */
84
388
  export declare const isRepliesSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
389
+ /**
390
+ * @example https://github.com/settings/profile
391
+ * @example https://github.com/settings/replies
392
+ * @example https://github.com/settings/replies/88491/edit
393
+ */
85
394
  export declare const isUserSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
395
+ /**
396
+ * @example https://github.com/sindresorhus/refined-github
397
+ * @example https://github.com/sindresorhus/refined-github/
398
+ * @example https://github.com/sindresorhus/notifications/
399
+ * @example https://github.com/sindresorhus/edit
400
+ * @example https://github.com/sindresorhus///edit
401
+ * @example https://github.com/sindresorhus/search
402
+ * @example https://github.com/sindresorhus/branches
403
+ * @example https://github.com/sindresorhus/refined-github?files=1
404
+ * @example https://github.com/sindresorhus/refined-github/tree/native-copy-buttons
405
+ * @example https://github.com/sindresorhus/refined-github/tree/native-copy-buttons/
406
+ * @example https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6
407
+ * @example https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6/
408
+ * @example https://github.com/sindresorhus/refined-github/tree/57bf4
409
+ * @example https://github.com/sindresorhus/refined-github/tree/master?files=1
410
+ * @example https://github.com/sindresorhus/refined-github/tree/main/source
411
+ * @example https://github.com/sindresorhus/refined-github/tree/0.13.0/extension
412
+ * @example https://github.com/sindresorhus/refined-github/tree/57bf435ee12d14b482df0bbd88013a2814c7512e/extension
413
+ * @example https://github.com/sindresorhus/refined-github?search=1
414
+ */
86
415
  export declare const isRepoTree: (url?: URL | HTMLAnchorElement | Location) => boolean;
416
+ /**
417
+ * @example https://github.com/lukesampson/scoop/wiki
418
+ * @example https://github.com/tooomm/wikitest/wiki/_new
419
+ * @example https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit
420
+ * @example https://github.com/brookhong/Surfingkeys/wiki/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d
421
+ * @example https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d
422
+ */
87
423
  export declare const isRepoWiki: (url?: URL | HTMLAnchorElement | Location) => boolean;
424
+ /**
425
+ * @example https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f
426
+ * @example https://github.com/sindresorhus/refined-github/commit/5b614
427
+ */
88
428
  export declare const isSingleCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
429
+ /**
430
+ * @example https://github.com/sindresorhus/refined-github/blob/master/.gitattributes
431
+ * @example https://github.com/sindresorhus/refined-github/blob/fix-narrow-diff/distribution/content.css
432
+ * @example https://github.com/sindresorhus/refined-github/blob/master/edit.txt
433
+ */
89
434
  export declare const isSingleFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
435
+ /**
436
+ * @example https://github.com/sindresorhus/refined-github/find/master
437
+ */
90
438
  export declare const isFileFinder: (url?: URL | HTMLAnchorElement | Location) => boolean;
91
439
  /**
92
440
  * @example https://github.com/fregante/GhostText/tree/3cacd7df71b097dc525d99c7aa2f54d31b02fcc8/chrome/scripts/InputArea
93
441
  * @example https://github.com/refined-github/refined-github/blob/some-non-existent-ref/source/features/bugs-tab.tsx
94
442
  */
95
443
  export declare const isRepoFile404: (url?: URL | HTMLAnchorElement | Location) => boolean;
444
+ /**
445
+ * @example https://github.com/sindresorhus/refined-github/network/members
446
+ */
96
447
  export declare const isRepoForksList: (url?: URL | HTMLAnchorElement | Location) => boolean;
448
+ /**
449
+ * @example https://github.com/sindresorhus/refined-github/network
450
+ */
97
451
  export declare const isRepoNetworkGraph: (url?: URL | HTMLAnchorElement | Location) => boolean;
98
452
  export declare const isForkedRepo: () => boolean;
453
+ /**
454
+ * @example https://github.com/refined-github/refined-github/fork
455
+ */
99
456
  export declare const isForkingRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
457
+ /**
458
+ * @example https://gist.github.com/fregante/2205329b71218fa2c1d3
459
+ * @example https://gist.github.com/fregante/2205329b71218fa2c1d3/d1ebf7d9cfaba4d4596d2ea9174e202479a5f9ad
460
+ * @example https://gist.github.com/sindresorhus/0ea3c2845718a0a0f0beb579ff14f064
461
+ */
100
462
  export declare const isSingleGist: (url?: URL | HTMLAnchorElement | Location) => boolean;
463
+ /**
464
+ * @example https://gist.github.com/kidonng/0d16c7f17045f486751fad1b602204a0/revisions
465
+ */
101
466
  export declare const isGistRevision: (url?: URL | HTMLAnchorElement | Location) => boolean;
467
+ /**
468
+ * @example https://github.com/trending
469
+ * @example https://github.com/trending/developers
470
+ * @example https://github.com/trending/unknown
471
+ */
102
472
  export declare const isTrending: (url?: URL | HTMLAnchorElement | Location) => boolean;
473
+ /**
474
+ * @example https://github.com/sindresorhus/refined-github/branches
475
+ */
103
476
  export declare const isBranches: (url?: URL | HTMLAnchorElement | Location) => boolean;
477
+ /**
478
+ * @example https://github.com/fregante
479
+ * @example https://github.com/github
480
+ * @example https://github.com/babel
481
+ * @example https://github.com/fregante?tab=repositories
482
+ * @example https://github.com/fregante?tab=repositories&type=source
483
+ * @example https://github.com/fregante?tab=repositories&q=&type=source&language=css&sort=
484
+ * @example https://github.com/fregante?tab=stars
485
+ * @example https://github.com/fregante?direction=desc&sort=updated&tab=stars
486
+ * @example https://github.com/fregante?tab=followers
487
+ * @example https://github.com/sindresorhus?tab=followers
488
+ * @example https://github.com/fregante?tab=following
489
+ * @example https://github.com/sindresorhus?tab=following
490
+ */
104
491
  export declare const isProfile: (url?: URL | HTMLAnchorElement | Location) => boolean;
492
+ /**
493
+ * @example https://gist.github.com/fregante
494
+ * @example https://gist.github.com/github
495
+ * @example https://gist.github.com/babel
496
+ * @example https://my-little-hub.com/gist/in-fragrante
497
+ * @example https://gist.my-little-hub.com/in-fragrante
498
+ */
105
499
  export declare const isGistProfile: (url?: URL | HTMLAnchorElement | Location) => boolean;
106
500
  export declare const isUserProfile: () => boolean;
107
501
  export declare const isPrivateUserProfile: () => boolean;
108
502
  export declare const isUserProfileMainTab: () => boolean;
503
+ /**
504
+ * @example https://github.com/fregante?tab=repositories
505
+ * @example https://github.com/fregante?tab=repositories&type=source
506
+ * @example https://github.com/fregante?tab=repositories&q=&type=source&language=css&sort=
507
+ */
109
508
  export declare const isUserProfileRepoTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
509
+ /**
510
+ * @example https://github.com/fregante?tab=stars
511
+ * @example https://github.com/fregante?direction=desc&sort=updated&tab=stars
512
+ */
110
513
  export declare const isUserProfileStarsTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
514
+ /**
515
+ * @example https://github.com/fregante?tab=followers
516
+ * @example https://github.com/sindresorhus?tab=followers
517
+ */
111
518
  export declare const isUserProfileFollowersTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
519
+ /**
520
+ * @example https://github.com/fregante?tab=following
521
+ * @example https://github.com/sindresorhus?tab=following
522
+ */
112
523
  export declare const isUserProfileFollowingTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
524
+ /**
525
+ * @example https://github.com/fregante?tab=repositories
526
+ * @example https://github.com/fregante?tab=repositories&type=source
527
+ * @example https://github.com/fregante?tab=repositories&q=&type=source&language=css&sort=
528
+ * @example https://github.com/orgs/refined-github/repositories
529
+ * @example https://github.com/orgs/refined-github/repositories?q=&type=private&language=&sort=
530
+ */
113
531
  export declare const isProfileRepoList: (url?: URL | HTMLAnchorElement | Location) => boolean;
114
532
  export declare const hasComments: (url?: URL | HTMLAnchorElement | Location) => boolean;
115
533
  export declare const hasRichTextEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
116
534
  /** Static code, not the code editor */
117
535
  export declare const hasCode: (url?: URL | HTMLAnchorElement | Location) => boolean;
118
- /** Covers blob, trees and blame pages */
536
+ /**
537
+ * Covers blob, trees and blame pages
538
+ * @example https://github.com/sindresorhus/refined-github
539
+ * @example https://github.com/sindresorhus/refined-github/
540
+ * @example https://github.com/sindresorhus/notifications/
541
+ * @example https://github.com/sindresorhus/edit
542
+ * @example https://github.com/sindresorhus///edit
543
+ * @example https://github.com/sindresorhus/search
544
+ * @example https://github.com/sindresorhus/branches
545
+ * @example https://github.com/sindresorhus/refined-github?files=1
546
+ * @example https://github.com/sindresorhus/refined-github/tree/native-copy-buttons
547
+ * @example https://github.com/sindresorhus/refined-github/tree/native-copy-buttons/
548
+ * @example https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6
549
+ * @example https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6/
550
+ * @example https://github.com/sindresorhus/refined-github/tree/57bf4
551
+ * @example https://github.com/sindresorhus/refined-github/tree/master?files=1
552
+ * @example https://github.com/sindresorhus/refined-github/tree/main/source
553
+ * @example https://github.com/sindresorhus/refined-github/tree/0.13.0/extension
554
+ * @example https://github.com/sindresorhus/refined-github/tree/57bf435ee12d14b482df0bbd88013a2814c7512e/extension
555
+ * @example https://github.com/sindresorhus/refined-github?search=1
556
+ * @example https://github.com/sindresorhus/refined-github/blob/master/.gitattributes
557
+ * @example https://github.com/sindresorhus/refined-github/blob/fix-narrow-diff/distribution/content.css
558
+ * @example https://github.com/sindresorhus/refined-github/blob/master/edit.txt
559
+ * @example https://github.com/sindresorhus/refined-github/blame/master/package.json
560
+ */
119
561
  export declare const isRepoGitObject: (url?: URL | HTMLAnchorElement | Location) => boolean;
120
562
  /** Has a list of files */
121
563
  export declare const hasFiles: (url?: URL | HTMLAnchorElement | Location) => boolean;
564
+ /**
565
+ * @example https://github.com/marketplace/actions/urlchecker-action
566
+ * @example https://github.com/marketplace/actions/github-action-for-assignee-to-reviewer
567
+ * @example https://github.com/marketplace/actions/hugo-actions
568
+ */
122
569
  export declare const isMarketplaceAction: (url?: URL | HTMLAnchorElement | Location) => boolean;
570
+ /**
571
+ * @example https://github.com/sindresorhus/refined-github/runs/639481849
572
+ * @example https://github.com/refined-github/github-url-detection/runs/1224552520?check_suite_focus=true
573
+ */
123
574
  export declare const isActionJobRun: (url?: URL | HTMLAnchorElement | Location) => boolean;
575
+ /**
576
+ * @example https://github.com/sindresorhus/refined-github/runs/639481849
577
+ * @example https://github.com/refined-github/github-url-detection/runs/1224552520?check_suite_focus=true
578
+ * @example https://github.com/refined-github/github-url-detection/actions/runs/294962314
579
+ */
124
580
  export declare const isActionRun: (url?: URL | HTMLAnchorElement | Location) => boolean;
581
+ /**
582
+ * @example https://github.com/sindresorhus/refined-github/actions/new
583
+ */
125
584
  export declare const isNewAction: (url?: URL | HTMLAnchorElement | Location) => boolean;
585
+ /**
586
+ * @example https://github.com/refined-github/github-url-detection/actions
587
+ * @example https://github.com/refined-github/github-url-detection/actions/workflows/demo.yml
588
+ * @example https://github.com/refined-github/github-url-detection/actions/workflows/esm-lint.yml
589
+ */
126
590
  export declare const isRepositoryActions: (url?: URL | HTMLAnchorElement | Location) => boolean;
127
591
  export declare const isUserTheOrganizationOwner: () => boolean;
128
592
  export declare const canUserAdminRepo: () => boolean;
129
- /** @deprecated Use `canUserAdminRepo` */
130
- export declare const canUserEditRepo: () => boolean;
593
+ /**
594
+ * @example https://github.com/new
595
+ * @example https://github.com/organizations/npmhub/repositories/new
596
+ */
131
597
  export declare const isNewRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
598
+ /**
599
+ * @example https://github.com/fregante/browser-extension-template/generate
600
+ */
132
601
  export declare const isNewRepoTemplate: (url?: URL | HTMLAnchorElement | Location) => boolean;
133
602
  export type NameWithOwner = `${string}/${string}`;
134
603
  export type RepositoryInfo = {
@@ -143,14 +612,17 @@ export type RepositoryInfo = {
143
612
  @example '/user/repo/' -> ''
144
613
  @example '/settings/token/' -> undefined */
145
614
  path: string;
615
+ /** The `path` segments
616
+ @example '/user/repo/' -> []
617
+ @example '/user/repo/issues/' -> ['issues']
618
+ @example '/user/repo/issues/new' -> ['issues', 'new'] */
619
+ pathParts: string[];
146
620
  };
147
621
  export declare const utils: {
148
622
  getOrg: (url?: URL | HTMLAnchorElement | Location) => {
149
623
  name: string;
150
624
  path: string;
151
625
  } | undefined;
152
- /** @deprecated Use `getLoggedInUser` */
153
- getUsername: () => string | undefined;
154
626
  getLoggedInUser: () => string | undefined;
155
627
  getCleanPathname: (url?: URL | HTMLAnchorElement | Location) => string;
156
628
  getCleanGistPathname: (url?: URL | HTMLAnchorElement | Location) => string | undefined;
@@ -77,10 +77,7 @@ var isEditingWikiPage = (url = location) => isRepoWiki(url) && getCleanPathname(
77
77
  var hasWikiPageEditor = (url = location) => isEditingWikiPage(url) || isNewWikiPage(url);
78
78
  var isRepo = (url = location) => {
79
79
  const [user, repo, extra] = getCleanPathname(url).split("/");
80
- return Boolean(
81
- user && repo && !reservedNames.includes(user) && !url.hostname.startsWith("gist.") && extra !== "generate"
82
- // Like isNewRepoTemplate but inlined for performance
83
- );
80
+ return Boolean(user && repo && !reservedNames.includes(user) && !url.hostname.startsWith("gist.") && extra !== "generate");
84
81
  };
85
82
  var hasRepoHeader = (url = location) => isRepo(url) && !isRepoSearch(url);
86
83
  var isEmptyRepoRoot = () => isRepoHome() && !exists('link[rel="canonical"]');
@@ -177,7 +174,6 @@ var isNewAction = (url = location) => getRepo(url)?.path === "actions/new";
177
174
  var isRepositoryActions = (url = location) => /^actions(\/workflows\/.+\.ya?ml)?$/.test(getRepo(url)?.path);
178
175
  var isUserTheOrganizationOwner = () => isOrganizationProfile() && exists('[aria-label="Organization"] [data-tab-item="org-header-settings-tab"]');
179
176
  var canUserAdminRepo = () => isRepo() && exists('.reponav-item[href$="/settings"], [data-tab-item$="settings-tab"]');
180
- var canUserEditRepo = canUserAdminRepo;
181
177
  var isNewRepo = (url = location) => !isGist(url) && (url.pathname === "/new" || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url)));
182
178
  var isNewRepoTemplate = (url = location) => Boolean(url.pathname.split("/")[3] === "generate");
183
179
  var getLoggedInUser = () => $('meta[name="user-login"]')?.getAttribute("content") ?? void 0;
@@ -213,18 +209,17 @@ var getRepo = (url) => {
213
209
  if (!isRepo(url)) {
214
210
  return;
215
211
  }
216
- const [owner, name, ...path] = getCleanPathname(url).split("/");
212
+ const [owner, name, ...pathParts] = getCleanPathname(url).split("/");
217
213
  return {
218
214
  owner,
219
215
  name,
216
+ pathParts,
220
217
  nameWithOwner: `${owner}/${name}`,
221
- path: path.join("/")
218
+ path: pathParts.join("/")
222
219
  };
223
220
  };
224
221
  var utils = {
225
222
  getOrg,
226
- /** @deprecated Use `getLoggedInUser` */
227
- getUsername: getLoggedInUser,
228
223
  getLoggedInUser,
229
224
  getCleanPathname,
230
225
  getCleanGistPathname,
@@ -233,7 +228,6 @@ var utils = {
233
228
  };
234
229
  export {
235
230
  canUserAdminRepo,
236
- canUserEditRepo,
237
231
  hasCode,
238
232
  hasComments,
239
233
  hasFileEditor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-url-detection",
3
- "version": "10.2.3",
3
+ "version": "11.0.0",
4
4
  "description": "Which GitHub page are you on? Is it an issue? Is it a list? Perfect for your WebExtension or userscript.",
5
5
  "keywords": [
6
6
  "github",
@@ -26,7 +26,8 @@
26
26
  "scripts": {
27
27
  "build": "run-p build:*",
28
28
  "build:esbuild": "esbuild index.ts --bundle --external:github-reserved-names --outdir=distribution --format=esm --drop-labels=TEST",
29
- "build:typescript": "tsc --declaration --emitDeclarationOnly",
29
+ "build:typescript": "tsc",
30
+ "postbuild:typescript": "node add-examples-to-dts.ts",
30
31
  "build:demo": "vite build demo",
31
32
  "try": "esbuild index.ts --bundle --global-name=x --format=iife | pbcopy && echo 'Copied to clipboard'",
32
33
  "fix": "xo --fix",
@@ -40,41 +41,25 @@
40
41
  "watch:demo": "vite preview demo & npm run build:demo -- --watch # vite serve isn't real",
41
42
  "xo": "xo"
42
43
  },
43
- "xo": {
44
- "envs": [
45
- "browser"
46
- ],
47
- "overrides": [
48
- {
49
- "files": [
50
- "*.ts"
51
- ],
52
- "rules": {
53
- "@typescript-eslint/triple-slash-reference": "off",
54
- "@typescript-eslint/naming-convention": "off",
55
- "no-unused-labels": "off",
56
- "no-labels": "off"
57
- }
58
- }
59
- ]
60
- },
61
44
  "dependencies": {
62
- "github-reserved-names": "^2.0.7"
45
+ "github-reserved-names": "^2.1.1"
63
46
  },
64
47
  "devDependencies": {
65
- "@sindresorhus/tsconfig": "^6.0.0",
66
- "@sveltejs/vite-plugin-svelte": "^3.1.1",
67
- "esbuild": "^0.23.1",
48
+ "@sindresorhus/tsconfig": "^8.1.0",
49
+ "@sveltejs/vite-plugin-svelte": "^6.2.4",
50
+ "@types/node": "^25.0.8",
51
+ "esbuild": "^0.27.2",
52
+ "globals": "^17.0.0",
68
53
  "npm-run-all": "^4.1.5",
69
- "strip-indent": "^4.0.0",
70
- "svelte": "^4.2.18",
71
- "svelte-check": "^3.8.5",
72
- "typescript": "^5.5.4",
73
- "vite": "^5.4.2",
74
- "vitest": "^2.0.5",
75
- "xo": "^0.59.3"
54
+ "strip-indent": "^4.1.1",
55
+ "svelte": "^5.46.1",
56
+ "svelte-check": "^4.3.5",
57
+ "typescript": "5.9.3",
58
+ "vite": "^7.3.1",
59
+ "vitest": "^4.0.17",
60
+ "xo": "^1.2.3"
76
61
  },
77
62
  "engines": {
78
- "node": ">=20.10"
63
+ "node": ">=22.18"
79
64
  }
80
65
  }