# URL subsystem

Contains code related to managing the URL

The primary API is found in UrlService, UrlService.config, and UrlService.rules.

## Index

### Classes

- BaseUrlRule
- UrlMatcher
- UrlMatcherFactory
- UrlRouter
- UrlRuleFactory
- UrlService

### Interfaces

- MatchResult
- MatcherUrlRule
- ParamFactory
- RegExpRule
- StateRule
- UrlConfigApi
- UrlMatcherConfig
- UrlParts
- UrlRule
- UrlRuleHandlerFn
- UrlRuleMatchFn
- UrlRulesApi
- UrlSyncApi

### Type aliases

- UrlRuleType

### Variables

- defaultRuleSortFn

### Functions

- getHandlerFn

## Type aliases

UrlRuleType: "STATE" | "URLMATCHER" | "REGEXP" | "RAW" | "OTHER"

- Defined in url/interface.ts:466

## Variables

defaultRuleSortFn: function

Default rule priority sorting function.

Default rule priority sorting function.

Sorts rules by:

- Explicit priority (set rule priority using UrlRulesApi.when)
- Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)
- `UrlMatcher` specificity (UrlMatcher.compare): works for STATE and URLMATCHER types to pick the most specific rule.
- Rule registration order (for rule types other than STATE and URLMATCHER)
  - Equally sorted State and UrlMatcher rules will each match the URL. Then, the best match is chosen based on how many parameter values were matched.

#### Type declaration

- - (a: UrlRule, b: UrlRule): number

  - #### Parameters

    - ##### a UrlRule

    - ##### b UrlRule

    #### Returns number

- Defined in url/urlRouter.ts:63

## Functions

- getHandlerFn(handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef): UrlRuleHandlerFn

- #### Parameters

  - ##### handler string | UrlRuleHandlerFn | TargetState | TargetStateDef

  #### Returns UrlRuleHandlerFn

  - Defined in url/urlRouter.ts:349

Generated using TypeDoc