@@ -389,10 +389,10 @@ export interface MatchResult {
389
389
/**
390
390
* A function that matches the URL for a [[UrlRule]]
391
391
*
392
- * Implementations should match against the current
393
- * [[UrlService.path]], [[UrlService.search]], and [[UrlService.hash]]
392
+ * Implementations should match against the provided [[UrlParts]] and return the matched value (truthy) if the rule matches.
393
+ * If this rule is selected, the matched value is passed to the [[UrlRuleHandlerFn]].
394
394
*
395
- * @return truthy or falsey
395
+ * @return the matched value, either truthy or falsey
396
396
*/
397
397
export interface UrlRuleMatchFn {
398
398
( url ?: UrlParts , router ?: UIRouter ) : any ;
@@ -402,7 +402,10 @@ export interface UrlRuleMatchFn {
402
402
* Handler invoked when a rule is matched
403
403
*
404
404
* The matched value from the rule's [[UrlRuleMatchFn]] is passed as the first argument
405
- * The handler should return a string (to redirect), or void
405
+ * The handler should return a string (to redirect), a [[TargetState]]/[[TargetStateDef]], or void
406
+ *
407
+ * If the handler returns a string, the url is replaced with the string.
408
+ * If the handler returns a [[TargetState]], the target state is activated.
406
409
*/
407
410
export interface UrlRuleHandlerFn {
408
411
( matchValue ?: any , url ?: UrlParts , router ?: UIRouter ) : ( string | TargetState | TargetStateDef | void ) ;
@@ -447,13 +450,17 @@ export interface UrlRule {
447
450
type : UrlRuleType ;
448
451
449
452
/**
450
- * This function should match the url and return match details
453
+ * This function should match the url and return the match details
454
+ *
455
+ * See [[UrlRuleMatchFn]] for details
451
456
*/
452
457
match : UrlRuleMatchFn ;
453
458
454
459
/**
455
- * This function is called after the rule matched the url .
460
+ * This function is called if the rule matched, and was selected as the "best match" .
456
461
* This function handles the rule match event.
462
+ *
463
+ * See [[UrlRuleHandlerFn]] for details
457
464
*/
458
465
handler : UrlRuleHandlerFn ;
459
466
}
0 commit comments