function Type(config) {
  extend(this, config);
}
@ngdoc object
@name ui.router.util.type:Type

@description
Implements an interface to define custom parameter types that can be decoded from and encoded to
string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}
objects when matching or formatting URLs, or comparing or validating parameter values.

See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more
information on registering custom types.

@param {Object} config  A configuration object which contains the custom type definition.  The object's
       properties will override the default methods and/or pattern in `Type`'s public interface.
@example
<pre>
{
  decode: function(val) { return parseInt(val, 10); },
  encode: function(val) { return val && val.toString(); },
  equals: function(a, b) { return this.is(a) && a === b; },
  is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
  pattern: /\d+/
}
</pre>

@property {RegExp} pattern The regular expression pattern used to match values of this type when
          coming from a substring of a URL.

@returns {Object}  Returns a new `Type` object.